Method, apparatus and system forming the sum of data in plural equal sections of a single data word

ABSTRACT

This invention is a technique for summing plural sections of a single data word. The technique uses a repeated process forming larger and larger partial sums. Initially the single data word is rotated one section. The original single data word and the rotated single data word are masked with a mask having &#34;1&#39;s&#34; and &#34;0&#39;s&#34; in alternate sections. The mask blocks alternate sections so that adjacent sections of the original data word may be summed on a whole data word basis without any overflow disrupting the partial products. The two masked data words are then summed. This sum results in half as many partial sums as before. Each of these larger partial sums now occupies two original sections of the data word. The process can be repeated for these large partial sums. In the preferred embodiment this technique is used with an arithmetic logic unit (230) capable of forming mixed arithmetic and Boolean combinations of three inputs having a barrel rotator (235) driving one input. The arithmetic logic unit (230) receives the single data word at a first input (241) and the rotated single data word at a second input (241). The mask supplies the third input (243). The arithmetic logic unit (230) then forms the combination (A&amp;C)+(B&amp;C), which is field addition of A and B as masked by C. With proper selection of the mask and the rotate amount, the three input arithmetic logic unit (230) forms the shift, mask and addition in a single cycle. In the preferred embodiment of this invention, the three input arithmetic logic unit (230) is embodied in at least one digital image/graphics processor (71) as a part of a multiprocessor (100) formed in a single integrated circuit used in image processing.

CROSS REFERENCE TO RELATED APPLICATIONS

This application relates to improvements in the inventions disclosed inthe following copending U.S. patent applications, all of which areassigned to Texas Instruments:

U.S. patent application Ser. No. 08/263,501 filed Jun. 21, 1994, nowabandoned, entitled "MULTI-PROCESSOR WITH CROSSBAR LINK OF PROCESSORSAND MEMORIES AND METHOD OF OPERATION", a continuation of U.S. patentapplication Ser. No. 08/135,754 filed Oct. 12, 1993 and now abandoned, acontinuation of U.S. patent application Ser. No. 07/933,865 filed Aug.21, 1993 and now abandoned, a continuation of U.S. patent applicationSer. No. 435,591 filed Nov. 17, 1989 and now abandoned;

U.S. Pat. No. 5,212,777, issued May 18, 1993, filed Nov. 17, 1989 andentitled "SIMD/MIMD RECONFIGURABLE MULTI-PROCESSOR AND METHOD OFOPERATION";

U.S. patent application Ser. No. 08/264,111 filed Jun. 22, 1994, nowU.S. Pat. No. 5,522,083, entitled "RECONFIGURABLE COMMUNICATIONS FORMULTI-PROCESSOR AND METHOD OF OPERATION," a continuation of U.S. patentapplication Ser. No. 07/895,565 filed Jun. 5, 1992 and now abandoned, acontinuation of U.S. patent application Ser. No. 07/437,856 filed Nov.17, 1989 and now abandoned;

U.S. patent application Ser. No. 08/264,582 filed Jun. 22, 1994 entitled"REDUCED AREA OF CROSSBAR AND METHOD OF OPERATION", a continuation ofU.S. patent application Ser. No. 07/437,852 filed Nov. 17, 1989 and nowabandoned;

U.S. patent application Ser. No. 08/032,530 filed Mar. 15, 1993 entitled"SYNCHRONIZED MIMD MULTI-PROCESSING SYSTEM AND METHOD OF OPERATION," acontinuation of U.S. patent application Ser. No. 07/437,853 filed Nov.17, 1989 and now abandoned;

U.S. Patent No. 5,197,140 issued Mar. 23, 1993 filed Nov. 17, 1989 andentitled "SLICED ADDRESSING MULTI-PROCESSOR AND METHOD OF OPERATION";

U.S. Pat. No. 5,339,447 issued Aug. 16, 1994 filed Nov. 17, 1989entitled "ONES COUNTING CIRCUIT, UTILIZING A MATRIX OF INTERCONNECTEDHALF-ADDERS, FOR COUNTING THE NUMBER OF ONES IN A BINARY STRING OF IMAGEDATA";

U.S. Pat. No. 5,239,654 issued Aug. 24, 1993 filed Nov. 17, 1989 andentitled "DUAL MODE SIMD/MIMD PROCESSOR PROVIDING REUSE OF MIMDINSTRUCTION MEMORIES AS DATA MEMORIES WHEN OPERATING IN SIMD MODE";

U.S. patent application Ser. No. 07/911,562, filed Jun. 29, 1992, nowU.S. Pat. No. 5,410,649, entitled "IMAGING COMPUTER AND METHOD OFOPERATION", a continuation of U.S. patent application Ser. No.07/437,854 filed Nov. 17, 1989 and now abandoned; and

U.S. Patent No. 5,226,125 issued Jul. 6, 1993 filed Nov. 17, 1989 andentitled "SWITCH MATRIX HAVING INTEGRATED CROSSPOINT LOGIC AND METHOD OFOPERATION".

This application is also related to the following concurrently filedU.S. patent applications, which include the same disclosure:

U.S. patent application Ser. No. 08/160,229, now U.S. Pat. No.5,490,828, "THREE INPUT ARITHMETIC LOGIC UNIT WITH BARREL ROTATOR";

U.S. patent application Ser. No. 08/158,742, now U.S. Pat. No.5,640,578, "ARITHMETIC LOGIC UNIT HAVING PLURAL INDEPENDENT SECTIONS ANDREGISTER STORING RESULTANT INDICATOR BIT FROM EVERY SECTION";

U.S. patent application Ser. No. 08/160,118 "MEMORY STORE FROM AREGISTER PAIR CONDITIONAL";

U.S. patent application Ser. No. 08/160,115, now abandoned, "ITERATIVEDIVISION APPARATUS, SYSTEM AND METHOD FORMING PLURAL QUOTIENT BITS PERITERATION" a continuation of U.S. patent application Ser. No. 08/160,115concurrently filed with this application and now abandoned;

U.S. patent application Ser. No. 08/158,285, now abandoned, "THREE INPUTARITHMETIC LOGIC UNIT FORMING MIXED ARITHMETIC AND BOOLEANCOMBINATIONS";

U.S. patent application Ser. No. 08/159,359, now U.S. Pat. No.5,512,896, "HUFFMAN ENCODING METHOD, CIRCUITS AND SYSTEM EMPLOYING MOSTSIGNIFICANT BIT CHANGE FOR SIZE DETECTION";

U.S. patent application Ser. No. 08/160,296, now U.S. Pat. No.5,479,166, "HUFFMAN DECODING METHOD, CIRCUIT AND SYSTEM EMPLOYINGCONDITIONAL SUBTRACTION FOR CONVERSION OF NEGATIVE NUMBERS";

U.S. patent application Ser. No. 08/160,112, "METHOD, APPARATUS ANDSYSTEM FOR SUM OF PLURAL ABSOLUTE DIFFERENCES";

U.S. patent application Ser. No. 08/160,120, now U.S. Pat. No.5,644,524, "ITERATIVE DIVISION APPARATUS, SYSTEM AND METHOD EMPLOYINGLEFT MOST ONE'S DETECTION AND LEFT MOST ONE'S DETECTION WITH EXCLUSIVEOR";

U.S. patent application Ser. No. 08/160,114, now U.S. Pat. No.5,712,999, "ADDRESS GENERATOR EMPLOYING SELECTIVE MERGE OF TWOINDEPENDENT ADDRESSES";

U.S. patent application Ser. No. 08/160,116, now U.S. Pat. No.5,420,809, "METHOD, APPARATUS AND SYSTEM METHOD FOR CORRELATION";

U.S. patent application Ser. No. 08/160,297, now U.S. Pat. No.5,509,129, "LONG INSTRUCTION WORD CONTROLLING PLURAL INDEPENDENTPROCESSOR OPERATIONS";

U.S. patent application Ser. No. 08/159,346 "ROTATION REGISTER FORORTHOGONAL DATA TRANSFORMATION";

U.S. patent application Ser. No. 08/159,652 "MEDIAN FILTER METHOD,CIRCUIT AND SYSTEM";

U.S. patent application Ser. No. 08/159,344, now U.S. Pat. No.5,805,913, "ARITHMETIC LOGIC UNIT WITH CONDITIONAL REGISTER SOURCESELECTION";

U.S. patent application Ser. No. 08/160,301 "APPARATUS, SYSTEM ANDMETHOD FOR DIVISION BY ITERATION"

U.S. patent application Ser. No. 08/159,650, now U.S. Pat. No.5,644,522, "MULTIPLY ROUNDING USING REDUNDANT CODED MULTIPLY RESULT";

U.S. patent application Ser. No. 08/159,349, now U.S. Pat. No. 5,446,651"SPLIT MULTIPLY OPERATION";

U.S. patent application Ser. No. 08/158,741, now abandoned, "MIXEDCONDITION TEST CONDITIONAL AND BRANCH OPERATIONS INCLUDING CONDITIONALTEST FOR ZERO";

U.S. patent application Ser. No. 08/160,302, now abandoned, "PACKED WORDPAIR MULTIPLY OPERATION";

U.S. patent application Ser. No. 08/160,573 "THREE INPUT ARITHMETICLOGIC UNIT WITH SHIFTER

U.S. patent application Ser. No. 08/159,282, now U.S. Pat. No.5,590,350, "THREE INPUT ARITHMETIC LOGIC UNIT WITH MASK GENERATOR";

U.S. patent application Ser. No. 08/160,111 "THREE INPUT ARITHMETICLOGIC UNIT WITH BARREL ROTATOR AND MASK GENERATOR";

U.S. patent application Ser. No. 08/160,298 "THREE INPUT ARITHMETICLOGIC UNIT WITH SHIFTER AND MASK GENERATOR";

U.S. patent application Ser. No. 08/159,345, now U.S. Pat. No.5,485,411, "THREE INPUT ARITHMETIC LOGIC UNIT FORMING THE SUM OF A FIRSTINPUT ADDED WITH A FIRST BOOLEAN COMBINATION OF A SECOND INPUT AND THIRDINPUT PLUS A SECOND BOOLEAN COMBINATION OF THE SECOND AND THIRD INPUTS";

U.S. patent application Ser. No. 08/160,113, now U.S. Pat. No.5,465,224, "THREE INPUT ARITHMETIC LOGIC UNIT FORMING THE SUM OF FIRSTBOOLEAN COMBINATION OF FIRST, SECOND AND THIRD INPUTS PLUS A SECONDBOOLEAN COMBINATION OF FIRST, SECOND AND THIRD INPUTS";

U.S. patent application Ser. No. 08/159,640, now abandoned, "THREE INPUTARITHMETIC LOGIC UNIT EMPLOYING CARRY PROPAGATE LOGIC"; and

U.S. patent application Ser. No. 08/160,300 "DATA PROCESSING APPARATUS,SYSTEM AND METHOD FOR IF, THEN, ELSE OPERATION USING WRITE PRIORITY."

TECHNICAL FIELD OF THE INVENTION

The technical field of this invention is the field of digital dataprocessing and more particularly microprocessor circuits, architecturesand methods for digital data processing especially digitalimage/graphics processing.

BACKGROUND OF THE INVENTION

This invention relates to the field of computer graphics and inparticular to bit mapped graphics. In bit mapped graphics computermemory stores data for each individual picture element or pixel of animage at memory locations that correspond to the location of that pixelwithin the image. This image may be an image to be displayed or acaptured image to be manipulated, stored, displayed or retransmitted.The field of bit mapped computer graphics has benefited greatly from thelowered cost and increased capacity of dynamic random access memory(DRAM) and the lowered cost and increased processing power ofmicroprocessors. These advantageous changes in the cost and performanceof component parts enable larger and more complex computer image systemsto be economically feasible.

The field of bit mapped graphics has undergone several stages inevolution of the types of processing used for image data manipulation.Initially a computer system supporting bit mapped graphics employed thesystem processor for all bit mapped operations. This type of systemsuffered several drawbacks. First, the computer system processor was notparticularly designed for handling bit mapped graphics. Design choicesthat are very reasonable for general purpose computing are unsuitablefor bit mapped graphics systems. Consequently some routine graphicstasks operated slowly. In addition, it was quickly discovered that theprocessing needed for image manipulation of bit mapped graphics was soloading the computational capacity of the system processor that otheroperations were also slowed.

The next step in the evolution of bit mapped graphics processing wasdedicated hardware graphics controllers. These devices can draw simplefigures, such as lines, ellipses and circles, under the control of thesystem processor. Many of these devices can also do pixel blocktransfers (PixBlt). A pixel block transfer is a memory move operation ofimage data from one portion of memory to another. A pixel block transferis useful for rendering standard image elements, such as alphanumericcharacters in a particular type font, within a display by transfer fromnondisplayed memory to bit mapped display memory. This function can alsobe used for tiling by transferring the same small image to the whole ofbit mapped display memory. The built-in algorithms for performing someof the most frequently used graphics functions provide a way ofimproving system performance. However, a useful graphics computer systemoften requires many functions besides those few that are implemented insuch a hardware graphics controller. These additional functions must beimplemented in software by the system processor. Typically thesehardware graphics controllers allow the system processor only limitedaccess to the bit map memory, thereby limiting the degree to whichsystem software can augment the fixed set of functions of the hardwaregraphics controller.

The graphics system processor represents yet a further step in theevolution of bit mapped graphics processing. A graphics system processoris a programmable device that has all the attributes of a microprocessorand also includes special functions for bit mapped graphics. TheTMS34010 and TMS34020 graphics system processors manufactured by TexasInstruments Incorporated represent this class of devices. These graphicssystem processors respond to a stored program in the same manner as amicroprocessor and include the capability of data manipulation via anarithmetic logic unit, data storage in register files and control ofboth program flow and external data memory. In addition, these devicesinclude special purpose graphics manipulation hardware that operateunder program control. Additional instructions within the instructionset of these graphics system processors controls the special purposegraphics hardware. These instructions and the hardware that supportsthem are selected to perform base level graphics functions that areuseful in many contexts. Thus a graphics system processor can beprogrammed for many differing graphics applications using algorithmsselected for the particular problem. This provides an increase inusefulness similar to that provided by changing from hardwarecontrollers to programmed microprocessors. Because such graphics systemprocessors are programmable devices in the same manner asmicroprocessors, they can operate as stand alone graphics processors,graphics co-processors slaved to a system processor or tightly coupledgraphics controllers.

New applications are driving the desire to provide more powerfulgraphics functions. Several fields require more cost effective graphicsoperations to be economically feasible. These include videoconferencing, multi-media computing with full motion video, highdefinition television, color facsimile and digital photography. Each ofthese fields presents unique problems, but image data compression anddecompression are common themes. The amount of transmission bandwidthand the amount of storage capacity required for images and particularfull motion video is enormous. Without efficient video compression anddecompression that result in acceptable final image quality, theseapplications will be limited by the costs associated with transmissionbandwidth and storage capacity. There is also a need in the art for asingle system that can support both image processing functions such asimage recognition and graphics functions such as display control.

SUMMARY OF THE INVENTION

This invention is a technique for summing plural sections of a singledata word. In the preferred embodiment an arithmetic logic unit may besplit into plural independent sections which perform the same operation.Using this feature often results in partial sums residing in thesections of a single data word. This invention enables formation of thesum from these partial sums.

The technique uses a repeated process forming larger and larger partialsums. Initially the single data word is rotated one section. This alignsadjacent sections of the rotated and original single data word. Then theoriginal single data word and the rotated single data word are maskedwith a mask having "1's" and "0's" in alternate sections. The maskblocks alternate sections so that adjacent sections of the original dataword may be summed on a whole data word basis without any overflowdisrupting the partial products. The two masked data words are thensummed. This sum results in half as many partial sums as before. Each ofthese larger partial sums now occupies two original sections of the dataword.

The process can be repeated for these large partial sums. Note thatduring each repetition the size in bits of the partial sums doubles. Thenew data word is rotated this new larger amount to align adjacent largerpartial sums. In addition the mask used to separate the still largerpartial sums must also take into account the greater size of the partialsums. It should be clear that this technique operates best on data wordsinitially divided into 2^(N) sections, where N is an integer. The totalsum can be formed with N repetitions of this technique.

In the preferred embodiment this technique is used with an arithmeticlogic unit capable of forming mixed arithmetic and Boolean combinationsof three inputs. A barrel rotator drives one input of the arithmeticlogic unit. The arithmetic logic unit receives the single data word at afirst input and the rotated single data word at the second input. Themask supplies the third input. For each repetition the appropriate maskand rotation control corresponding to the size of the partial sum mustbe supplied. The arithmetic logic unit then forms the combination(A&C)+(B&C), which is field addition of A and B as masked by C. Withproper selection of the mask and the rotate amount, the three inputarithmetic logic unit forms the shift, mask and addition in a singlecycle. As an example a 32 bit data word having four 8 bit partial sumscan be converted into a 10 bit final sum in two instructions. Thusforming multiple partial sums using plural sections of the arithmeticlogic unit may be advantageous even for a small number of such sums.

In the preferred embodiment of this invention, the three inputarithmetic logic unit is embodied in at least one digital image/graphicsprocessor as a part of a multiprocessor formed in a single integratedcircuit used in image processing.

BRIEF DESCRIPTION OF THE FIGURES

These and other aspects of the present invention are described belowtogether with the Figures, in which:

FIG. 1 illustrates the system architecture of an image processing systemsuch as would employ this invention;

FIG. 2 illustrates the architecture of a single integrated circuitmultiprocessor that forms the preferred embodiment of this invention;

FIG. 3 illustrates in block diagram form one of the digitalimage/graphics processors illustrated in FIG. 2;

FIG. 4 illustrates in schematic form the pipeline stages of operation ofthe digital image/graphics processor illustrated in FIG. 2;

FIG. 5 illustrates in block diagram form the data unit of the digitalimage/graphics processors illustrated in FIG. 3;

FIG. 6 illustrates in schematic form field definitions of the statusregister of the data unit illustrated in FIG. 5;

FIG. 7 illustrates in block diagram form the manner of splitting thearithmetic logic unit of the data unit illustrated in FIG. 5;

FIG. 8 illustrates in block diagram form the manner of addressing thedata register of the data unit illustrated in FIG. 5 as a rotationregister;

FIG. 9 illustrates in schematic form the field definitions of the firstdata register of the data unit illustrated in FIG. 5;

FIG. 10a illustrates in schematic form the data input format for 16 bitby 16 bit signed multiplication operands;

FIG. 10b illustrates in schematic form the data output format for 16 bitby 16 bit signed multiplication results;

FIG. 10c illustrates in schematic form the data input format for 16 bitby 16 bit unsigned multiplication operands;

FIG. 10d illustrates in schematic form the data output format for 16 bitby 16 bit unsigned multiplication results;

FIG. 11a illustrates in schematic form the data input format for dual 8bit by 8 bit signed multiplication operands;

FIG. 11b illustrates in schematic form the data input format for dual 8bit by 8 bit unsigned multiplication operands;

FIG. 11c illustrates in schematic form the data output format for dual 8bit by 8 bit signed multiplication results;

FIG. 11d illustrates in schematic form the data output format for dual 8bit by 8 bit unsigned multiplication results;

FIG. 12 illustrates in block diagram form the multiplier illustrated inFIG. 5;

FIG. 13 illustrates in schematic form generation of Booth quads for thefirst operand in 16 bit by 16 bit multiplication;

FIG. 14 illustrates in schematic form generation of Booth quads for dualfirst operands in 8 bit by 8 bit multiplication;

FIG. 15a illustrates in schematic form the second operand supplied tothe partial product generators illustrated in FIG. 12 in 16 bit by 16bit unsigned multiplication;

FIG. 15b illustrates in schematic form the second operand supplied tothe partial product generators illustrated in FIG. 12 in 16 bit by 16bit signed multiplication;

FIG. 16a illustrates in schematic form the second operand supplied tothe first three partial product generators illustrated in FIG. 12 indual 8 bit by 8 bit unsigned multiplication;

FIG. 16b illustrates in schematic form the second operand supplied tothe first three partial product generators illustrated in FIG. 12 indual 8 bit by 8 bit signed multiplication;

FIG. 16c illustrates in schematic form the second operand supplied tothe second three partial product generators illustrated in FIG. 12 indual 8 bit by 8 bit unsigned multiplication;

FIG. 16d illustrates in schematic form the second operand supplied tothe second three partial product generators illustrated in FIG. 12 indual 8 bit by 8 bit signed multiplication;

FIG. 17a illustrates in schematic form the output mapping for 16 bit by16 bit multiplication;

FIG. 17b illustrates in schematic form the output mapping for dual 8 bitby 8 bit multiplication;

FIG. 18 illustrates in block diagram form the details of theconstruction of the rounding adder 226 illustrated in FIG. 5;

FIG. 19 illustrates in block diagram form the construction of one bitcircuit of the arithmetic logic unit of the data unit illustrated inFIG. 5;

FIG. 20 illustrates in schematic form the construction of the resultantlogic and carry out logic of the bit circuit illustrated in FIG. 19;

FIG. 21 illustrates in schematic form the construction of the Booleanfunction generator of the bit circuit illustrated in FIG. 19;

FIG. 22 illustrates in block diagram form the function signal selectorof the function signal generator of the data unit illustrated in FIG. 5;

FIG. 23 illustrates in block diagram form the function signal modifierportion of the function signal generator of the data unit illustrated inFIG. 5;

FIG. 24 illustrates in block diagram form the bit 0 carry-in generatorof the data unit illustrated in FIG. 5;

FIG. 25 illustrates in block diagram form a conceptual view of thearithmetic logic unit illustrated in FIGS. 19 and 20;

FIG. 26 illustrates in block diagram form a conceptual view of analternative embodiment of the arithmetic logic unit;

FIG. 27 illustrates in block diagram form the address unit of thedigital image/graphics processor illustrated in FIG. 3;

FIG. 28 illustrates in block diagram form an example of a global or alocal address unit of the address unit illustrated in FIG. 27;

FIG. 29a illustrates the order of data bytes according to the littleendian mode;

FIG. 29b illustrates the order of data bytes according to the big endianmode;

FIG. 30 illustrates a circuit for data selection, data alignment andsign or zero extension in each data port of a digital image/graphicsprocessor;

FIG. 31 illustrates in block diagram form the program flow control unitof the digital image/graphics processors illustrated in FIG. 3;

FIG. 32 illustrates in schematic form the field definitions of theprogram counter of the program flow control unit illustrated in FIG. 31;

FIG. 33 illustrates in schematic form the field definitions of theinstruction pointer-address stage register of the program flow controlunit illustrated in FIG. 31;

FIG. 34 illustrates in schematic form the field definitions of theinstruction pointer-return from subroutine register of the program flowcontrol unit illustrated in FIG. 31;

FIG. 35 illustrates in schematic form the field definitions of the cachetag registers of the program flow control unit illustrated in FIG. 31;

FIG. 36 illustrates in schematic form the field definitions of the looplogic control register of the program flow control unit illustrated inFIG. 31;

FIG. 37 illustrates in block diagram form the loop logic circuit of theprogram flow control unit;

FIG. 38 illustrates in flow chart form a program example of a singleprogram loop with multiple loop ends;

FIG. 39 illustrates the overlapping pipeline stages in an example of asoftware branch from a single instruction hardware loop;

FIG. 40 illustrates in schematic form the field definitions of theinterrupt enable register and the interrupt flag register of the programflow control unit illustrated in FIG. 31;

FIG. 41 illustrates in schematic form the field definitions of a commandword transmitted between processors of the single integrated circuitmultiprocessor illustrated in FIG. 2;

FIG. 42 illustrates in schematic form the field definitions of thecommunications register of the program flow control unit illustrated inFIG. 31;

FIG. 43 illustrates in schematic form the instruction word controllingthe operation of the digital image/graphics processor illustrated inFIG. 3;

FIG. 44 illustrates in schematic form data flow within the data unitduring execution of a divide iteration instruction;

FIG. 45 illustrates in flow chart form the use of a left most one'sfunction in a division algorithm;

FIG. 46 illustrates in flow chart form the use of a left most one'sfunction and an exclusive OR in a division algorithm;

FIG. 47 illustrates in schematic form within the data flow during anexample sum of absolute value of differences algorithm;

FIGS. 48a, 48b, 48c, 48d and 48e illustrate in schematic form a medianfilter algorithm;

FIG. 49 illustrates the overlapping pipeline stages in an example of asingle instruction hardware loop with a conditional hardware branch;

FIG. 50 illustrates in schematic form a hardware divider that generatestwo bits of the desired quotient per divide iteration;

FIG. 51 illustrates in schematic form the data flow within the hardwaredivider illustrated in FIG. 48;

FIG. 52 illustrates in schematic form a hardware divider that generatesthree bits of the desired quotient per divide iteration;

FIG. 53 illustrates in schematic form the data flow within a hardwaredivider illustrated in FIG. 51; and

FIG. 54 illustrates in schematic form the multiprocessor integratedcircuit of this invention having a single digital image/graphicsprocessor in color facsimile system.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

FIG. 1 is a block diagram of an image data processing system including amultiprocessor integrated circuit constructed for image and graphicsprocessing according to this invention. This data processing systemincludes a host processing system 1. Host processing system 1 providesthe data processing for the host system of data processing system ofFIG. 1. Included in the host processing system 1 are a processor, atleast one input device, a long term storage device, a read only memory,a random access memory and at least one host peripheral 2 coupled to ahost system bus. Arrangement and operation of the host processing systemare considered conventional. Because of its processing functions, thehost processing system 1 controls the function of the image dataprocessing system.

Multiprocessor integrated circuit 100 provides most of the dataprocessing including data manipulation and computation for imageoperations of the image data processing system of FIG. 1. Multiprocessorintegrated circuit 100 is bi-directionally coupled to an image systembus and communicates with host processing system 1 by way of this imagesystem bus. In the arrangement of FIG. 1, multiprocessor integratedcircuit 100 operates independently from the host processing system 1.The multiprocessor integrated circuit 100, however, is responsive tohost processing system 1.

FIG. 1 illustrates two image systems. Imaging device 3 represents adocument scanner, charge coupled device scanner or video camera thatserves as an image input device. Imagine device 3 supplies this image toimage capture controller 4, which serves to digitize the image and formit into raster scan frames. This frame capture process is controlled bysignals from multiprocessor integrated circuit 100. The thus formedimage frames are stored in video random access memory 5. Video randomaccess memory 5 may be accessed via the image system bus permitting datatransfer for image processing by multiprocessor integrated circuit 100.

The second image system drives a video display. Multiprocessorintegrated circuit 100 communicates with video random access memory 6for specification of a displayed image via a pixel map. Multiprocessorintegrated circuit 100 controls the image data stored in video randomaccess memory 6 via the image system bus. Data corresponding to thisimage is recalled from video random access memory 6 and supplied tovideo palette 7. Video palette 7 may transform this recalled data intoanother color space, expand the number of bits per pixel and the like.This conversion may be accomplished through a look-up table. Videopalette 7 also generates the proper video signals to drive video display8. If these video signals are analog signals, then video palette 7includes suitable digital to analog conversion. The video level signaloutput from the video palette 7 may include color, saturation, andbrightness information. Multiprocessor integrated circuit 100 controlsdata stored within the video palette 7, thus controlling the datatransformation process and the timing of image frames. Multiprocessorintegrated circuit 100 can control the line length and the number oflines per frame of the video display image, the synchronization,retrace, and blanking signals through control of video palette 7.Significantly, multiprocessor integrated circuit 100 determines andcontrols where graphic display information is stored in the video randomaccess memory 6. Subsequently, during readout from the video randomaccess memory 6, multiprocessor integrated circuit 100 determines thereadout sequence from the video random access memory 6, the addresses tobe accessed, and control information needed to produce the desiredgraphic image on video display 8.

Video display 8 produces the specified video display for viewing by theuser. There are two widely used techniques. The first techniquespecifies video data in terms of color, hue, brightness, and saturationfor each pixel. For the second technique, color levels of red, blue andgreen are specified for each pixel. Video palette 7 the video display 8is designed and fabricated to be compatible with the selected technique.

FIG. 1 illustrates an addition memory 9 coupled to the image system bus.This additional memory may include additional video random accessmemory, dynamic random access memory, static random access memory orread only memory. Multiprocessor integrated circuit 100 may becontrolled either in wholly or partially by a program stored in thememory 9. This memory 9 may also store various types of graphic imagedata. In addition, multiprocessor integrated circuit 100 preferablyincludes memory interface circuits for video random access memory,dynamic random access memory and static random access memory. Thus asystem could be constructed using multiprocessor integrated circuit 100without any video random access memory 5 or 6.

FIG. 1 illustrates transceiver 16. Transceiver 16 provides translationand bidirectional communication between the image system bus and acommunications channel. One example of a system employing transceiver 16is video conferencing. The image data processing system illustrated inFIG. 1 employs imaging device 3 and image capture controller 4 to form avideo image of persons at a first location. Multiprocessor integratedcircuit 100 provides video compression and transmits the compressedvideo signal to a similar image data processing system at anotherlocation via transceiver 16 and the communications channel. Transceiver16 receives a similarly compressed video signal from the remote imagedata processing system via the communications channel. Multiprocessorintegrated circuit 100 decompresses this received signal and controlsvideo random access memory 6 and video palette 7 to display thecorresponding decompressed video signal on video display 8. Note this isnot the only example where the image data processing system employstransceiver 16. Also note that the bidirectional communications need notbe the same type signals. For example, in an interactive cabletelevision signal the cable system head in would transmit compressedvideo signals to the image data processing system via the communicationschannel. The image data processing system could transmit control anddata signals back to the cable system head in via transceiver 16 and thecommunications channel.

FIG. 1 illustrates multiprocessor integrated circuit 100 embodied in asystem including host processing system 1. Those skilled in the artwould realize from the following disclosure of the invention thatmultiprocessor integrated circuit 100 may be employed as the onlyprocessor of a useful system. In such a system multiprocessor integratedcircuit 100 is programmed to perform all the functions of the system.

This invention is particularly useful in a processor used for imageprocessing. According to the preferred embodiment, this invention isembodied in multiprocessor integrated circuit 100. This preferredembodiment includes plural identical processors that embody thisinvention. Each of these processors will be called a digitalimage/graphics processor. This description is a matter of convenienceonly. The processor embodying this invention can be a processorseparately fabricated on a single integrated circuit or a plurality ofintegrated circuits. If embodied on a single integrated circuit, thissingle integrated circuit may optionally also include read only memoryand random access memory used by the digital image/graphics processor.

FIG. 2 illustrates the architecture of the multiprocessor integratedcircuit 100 of the preferred embodiment of this invention.Multiprocessor integrated circuit 100 includes: two random accessmemories 10 and 20, each of which is divided into plural sections;crossbar 50; master processor 60; digital image/graphics processors 71,72, 73 and 74; transfer controller 80, which mediates access to systemmemory; and frame controller 90, which can control access to independentfirst and second image memories. Multiprocessor integrated circuit 100provides a high degree of operation parallelism, which will be useful inimage processing and graphics operations, such as in the multi-mediacomputing.

Multiprocessor integrated circuit 100 includes two random accessmemories. Random access memory 10 is primarily devoted to masterprocessor 60. It includes two instruction cache memories 11 and 12, twodata cache memories 13 and 14 and a parameter memory 15. These memorysections can be physically identical, but connected and useddifferently. Random access memory 20 may be accessed by master processor60 and each of the digital image/graphics processors 71, 72, 73 and 74.Each digital image/graphics processor 71, 72, 73 and 74 has fivecorresponding memory sections. These include an instruction cachememory, three data memories and one parameter memory. Thus digitalimage/graphics processor 71 has corresponding instruction cache memory21, data memories 22, 23, 24 and parameter memory 25; digitalimage/graphics processor 72 has corresponding instruction cache memory26, data memories 27, 28, 29 and parameter memory 30; digitalimage/graphics processor 73 has corresponding instruction cache memory31, data memories 32, 33, 34 and parameter memory 35; and digitalimage/graphics processor 74 has corresponding instruction cache memory36, data memories 37, 38, 39 and parameter memory 40. Like the sectionsof random access memory 10, these memory sections can be physicallyidentical but connected and used differently. Each of these memorysections of memories 10 and 20 preferably includes 2 K bytes, with atotal memory within multiprocessor integrated circuit 100 of 50 K bytes.

Multiprocessor integrated circuit 100 is constructed to provide a highrate of data transfer between processors and memory using pluralindependent parallel data transfers. Crossbar 50 enables these datatransfers. Each digital image/graphics processor 71, 72, 73 and 74 hasthree memory ports that may operate simultaneously each cycle. Aninstruction port (I) may fetch 64 bit data words from the correspondinginstruction cache. A local data port (L) may read a 32 bit data wordfrom or write a 32 bit data word into the data memories or the parametermemory corresponding to that digital image/graphics processor. A globaldata port (G) may read a 32 bit data word from or write a 32 bit dataword into any of the data memories or the parameter memories or randomaccess memory 20. Master Processor 60 includes two memory ports. Aninstruction port (I) may fetch a 32 bit instruction word from either ofthe instruction caches 11 and 12. A data port (C) may read a 32 bit dataword from or write a 32 bit data word into data caches 13 or 14,parameter memory 15 of random access memory 10 or any of the datamemories, the parameter memories of random access memory 20. Transfercontroller 80 can access any of the sections of random access memory 10or 20 via data port (C). Thus fifteen parallel memory accesses may berequested at any single memory cycle. Random access memories 10 and 20are divided into 25 memories in order to support so many parallelaccesses.

Crossbar 50 controls the connections of master processor 60, digitalimage/graphics processors 71, 72, 73 and 74, and transfer controller 80with memories 10 and 20. Crossbar 50 includes a plurality of crosspoints51 disposed in rows and columns. Each column of crosspoints 51corresponds to a single memory section and a corresponding range ofaddresses. A processor requests access to one of the memory sectionsthrough the most significant bits of an address output by thatprocessor. This address output by the processor travels along a row. Thecrosspoint corresponding to the memory section having that addressresponds either by granting or denying access to the memory section. Ifno other processor has requested access to that memory section duringthe current memory cycle, then the crosspoint grants access by couplingthe row and column. This supplies the address to the memory section. Thememory section responds by permitting data access at that address. Thisdata access may be either a data read operation or a data writeoperation.

If more than one processor requests access to the same memory sectionsimultaneously, then crossbar 50 grants access to only one of therequesting processors. The crosspoints 51 in each column of crossbar 50communicate and grant access based upon a priority hierarchy. If tworequests for access having the same rank occur simultaneously, thencrossbar 50 grants access on a round robin basis, with the processorlast granted access having the lowest priority. Each granted accesslasts as long as needed to service the request. The processors maychange their addresses every memory cycle, so crossbar 50 can change theinterconnection between the processors and the memory sections on acycle by cycle basis.

Master processor 60 preferably performs the major control functions formultiprocessor integrated circuit 100. Master processor 60 is preferablya 32 bit reduced instruction set computer (RISC) processor including ahardware floating point calculation unit. According to the RISCarchitecture, all accesses to memory are performed with load and storeinstructions and most integer and logical operations are performed onregisters in a single cycle. The floating point calculation unit,however, will generally take several cycles to perform operations whenemploying the same register file as used by the integer and logicalunit. A register score board ensures that correct register accesssequences are maintained. The RISC architecture is suitable for controlfunctions in image processing. The floating point calculation unitpermits rapid computation of image rotation functions, which may beimportant to image processing.

Master processor 60 fetches instruction words from instruction cachememory 11 or instruction cache memory 12. Likewise, master processor 60fetches data from either data cache 13 or data cache 14. Since eachmemory section includes 2 K bytes of memory, there is 4 K bytes ofinstruction cache and 4 K bytes of data cache. Cache control is anintegral function of master processor 60. As previously mentioned,master processor 60 may also access other memory sections via crossbar50.

The four digital image/graphics processors 71, 72, 73 and 74 each have ahighly parallel digital signal processor (DSP) architecture. FIG. 3illustrates an overview of exemplary digital image/graphics processor71, which is identical to digital image/graphics processors 72, 73 and74. Digital image/graphics processor 71 achieves a high degree ofparallelism of operation employing three separate units: data unit 110;address unit 120; and program flow control unit 130. These three unitsoperate simultaneously on different instructions in an instructionpipeline. In addition each of these units contains internal parallelism.

The digital image/graphics processors 71, 72, 73 and 74 can executeindependent instruction streams in the multiple instruction multipledata mode (MIMD). In the MIMD mode, each digital image/graphicsprocessor executes an individual program from its correspondinginstruction cache, which may be independent or cooperative. In thelatter case crossbar 50 enables inter-processor communication incombination with the shared memory. Digital image/graphics processors71, 72, 73 and 74 may also operate in a synchronized MIMD mode. In thesynchronized MIMD mode, the program control flow unit 130 of eachdigital image/graphics processor inhibits fetching the next instructionuntil all synchronized processors are ready to proceed. Thissynchronized MIMD mode allows the separate programs of the digitalimage/graphics processors to be executed in lock step in a closelycoupled operation.

Digital image/graphics processors 71, 72, 73 and 74 can executeidentical instructions on differing data in the single instructionmultiple data mode (SIMD). In this mode a single instruction stream forthe four digital image/graphics processors comes from instruction cachememory 21. Digital image/graphics processor 71 controls the fetching andbranching operations and crossbar 50 supplies the same instruction tothe other digital image/graphics processors 72, 73 and 74. Since digitalimage/graphics processor 71 controls instruction fetch for all thedigital image/graphics processors 71, 72, 73 and 74, the digitalimage/graphics processors are inherently synchronized in the SIMD mode.

Transfer controller 80 is a combined direct memory access (DMA) machineand memory interface for multiprocessor integrated circuit 100. Transfercontroller 80 intelligently queues, sets priorities and services thedata requests and cache misses of the five programmable processors.Master processor 60 and digital image/graphics processors 71, 72, 73 and74 all access memory and systems external to multiprocessor integratedcircuit 100 via transfer controller 80. Data cache or instruction cachemisses are automatically handled by transfer controller 80. The cacheservice (S) port transmits such cache misses to transfer controller 80.Cache service port (S) reads information from the processors and notfrom memory. Master processor 60 and digital image/graphics processors71, 72, 73 and 74 may request data transfers from transfer controller 80as linked list packet requests. These linked list packet requests allowmulti-dimensional blocks of information to be transferred between sourceand destination memory addresses, which can be within multiprocessorintegrated circuit 100 or external to multiprocessor integrated circuit100. Transfer controller 80 preferably also includes a refreshcontroller for dynamic random access memory (DRAM) which requireperiodic refresh to retain their data.

Frame controller 90 is the interface between multiprocessor integratedcircuit 100 and external image capture and display systems. Framecontroller 90 provides control over capture and display devices, andmanages the movement of data between these devices and memoryautomatically. To this end, frame controller 90 provides simultaneouscontrol over two independent image systems. These would typicallyinclude a first image system for image capture and a second image systemfor image display, although the application of frame controller 90 iscontrolled by the user. These image systems would ordinarily includeindependent frame memories used for either frame grabber or frame bufferstorage. Frame controlled 90 preferably operates to control videodynamic random access memory (VRAM) through refresh and shift registercontrol.

Multiprocessor integrated circuit 100 is designed for large scale imageprocessing. Master processor 60 provides embedded control, orchestratingthe activities of the digital image/graphics processors 71, 72, 73 and74, and interpreting the results that they produce. Digitalimage/graphics processors 71, 72, 73 and 74 are well suited to pixelanalysis and manipulation. If pixels are thought of as high in data butlow in information, then in a typical application digital image/graphicsprocessors 71, 72, 73 and 74 might well examine the pixels and turn theraw data into information. This information can then be analyzed eitherby the digital image/graphics processors 71, 72, 73 and 74 or by masterprocessor 60. Crossbar 50 mediates inter-processor communication.Crossbar 50 allows multiprocessor integrated circuit 100 to beimplemented as a shared memory system. Message passing need not be aprimary form of communication in this architecture. However, messagescan be passed via the shared memories. Each digital image/graphicsprocessor, the corresponding section of crossbar 50 and thecorresponding sections of memory 20 have the same width. This permitsarchitecture flexibility by accommodating the addition or removal ofdigital image/graphics processors and corresponding memory modularlywhile maintaining the same pin out.

In the preferred embodiment all parts of multiprocessor integratedcircuit 100 are disposed on a single integrated circuit. In thepreferred embodiment, multiprocessor integrated circuit 100 is formed incomplementary metal oxide semiconductor (CMOS) using feature sizes of0.6 μm. Multiprocessor integrated circuit 100 is preferably constructedin a pin grid array package having 256 pins. The inputs and outputs arepreferably compatible with transistor-transistor logic (TTL) logicvoltages. Multiprocessor integrated circuit 100 preferably includesabout 3 million transistors and employs a clock rate of 50M Hz.

FIG. 3 illustrates an overview of exemplary digital image/graphicsprocessor 71, which is virtually identical to digital image/graphicsprocessors 72, 73 and 74. Digital image/graphics processor 71 includes:data unit 110; address unit 120; and program flow control unit 130. Dataunit 110 performs the logical or arithmetic data operations. Data unit110 includes eight data registers D7-D0, a status register 210 and amultiple flags register 211. Address unit 120 controls generation ofload/store addresses for the local data port and the global data port.As will be further described below, address unit 120 includes twovirtually identical addressing units, one for local addressing and onefor global addressing. Each of these addressing units includes an all"0" read only register enabling absolute addressing in a relativeaddress mode, a stack pointer, five address registers and three indexregisters. The addressing units share a global bit multiplex controlregister used when forming a merging address from both address units.Program flow control unit 130 controls the program flow for the digitalimage/graphics processor 71 including generation of addresses forinstruction fetch via the instruction port. Program flow control unit130 includes; a program counter PC 701; an instruction pointer-addressstage IRA 702 that holds the address of the instruction currently in theaddress pipeline stage; an instruction pointer-execute stage IRE 703that holds the address of the instruction currently in the executepipeline stage; an instruction pointer-return from subroutine IPRS 704holding the address for returns from subroutines; a set of registerscontrolling zero overhead loops; four cache tag registers TAG3-TAG0collectively called 708 that hold the most significant bits of fourblocks of instruction words in the corresponding instruction cachememory.

Digital image/graphics processor 71 operates on a three stage pipelineas illustrated in FIG. 4. Data unit 110, address unit 120 and programflow control unit 130 operate simultaneously on different instructionsin an instruction pipeline. The three stages in chronological order arefetch, address and execute. Thus at any time, digital image/graphicsprocessor 71 will be operating on differing functions of threeinstructions. The phrase pipeline stage is used instead of referring toclock cycles, to indicate that specific events occur when the pipelineadvances, and not during stall conditions.

Program flow control unit 130 performs all the operations that occurduring the fetch pipeline stage. Program flow control unit 130 includesa program counter, loop logic, interrupt logic and pipeline controllogic. During the fetch pipeline stage, the next instruction word isfetched from memory. The address contained in the program counter iscompared with cache tag registers to determine if the next instructionword is stored in instruction cache memory 21. Program flow control unit130 supplies the address in the program counter to the instruction portaddress bus 131 to fetch this next instruction word from instructioncache memory 21 if present. Crossbar 50 transmits this address to thecorresponding instruction cache, here instruction cache memory 21, whichreturns the instruction word on the instruction bus 132. Otherwise, acache miss occurs and transfer controller 80 accesses external memory toobtain the next instruction word. The program counter is updated. If thefollowing instruction word is at the next sequential address, programcontrol flow unit 130 post increments the program counter. Otherwise,program control flow unit 130 loads the address of the next instructionword according to the loop logic or software branch. If the synchronizedMIMD mode is active, then the instruction fetch waits until all thespecified digital image/graphics processors are synchronized, asindicated by sync bits in a communications register.

Address unit 120 performs all the address calculations of the addresspipeline stage. Address unit 120 includes two independent address units,one for the global port and one for the local port. If the instructioncalls for one or two memory accesses, then address unit 120 generatesthe address(es) during the address pipeline stage. The address(es) aresupplied to crossbar 50 via the respective global port address bus 121and local port address bus 122 for contention detection/prioritization.If there is no contention, then the accessed memory prepares to allowthe requested access, but the memory access occurs during the followingexecute pipeline stage.

Data unit 110 performs all of the logical and arithmetic operationsduring the execute pipeline stage. All logical and arithmetic operationsand all data movements to or from memory occur during the executepipeline stage. The global data port and the local data port completeany memory accesses, which are begun during the address pipeline stage,during the execute pipeline stage. The global data port and the localdata port perform all data alignment needed by memory stores, and anydata extraction and sign extension needed by memory loads. If theprogram counter is specified as a data destination during any operationof the execute pipeline stage, then a delay of two instructions isexperienced before any branch takes effect. The pipelined operationrequires this delay, since the next two instructions following such abranch instruction have already been fetched. According to the practicein RISC processors, other useful instructions may be placed in the twodelay slot positions.

Digital image/graphics processor 71 includes three internal 32 bit databusses. These are local port data bus Lbus 103, global port source databus Gsrc 105 and global port destination data bus Gdst 107. These threebuses interconnect data unit 110, address unit 120 and program flowcontrol unit 130. These three buses are also connected to a data portunit 140 having a local port 141 and global port 145. Data port unit 140is coupled to crossbar 50 providing memory access.

Local data port 141 has a buffer 142 for data stores to memory. Amultiplexer/buffer circuit 143 loads data onto Lbus 103 from local portdata bus 144 from memory via crossbar 50, from a local port address bus122 or from global port data bus 148. Local port data bus Lbus 103 thuscarries 32 bit data that is either register sourced (stores) or memorysourced (loads). Advantageously, arithmetic results in address unit 120can be supplied via local port address bus 122, multiplexer buffer 143to local port data bus Lbus 103 to supplement the arithmetic operationsof data unit 110. This will be further described below. Buffer 142 andmultiplexer buffer 143 perform alignment and extraction of data. Localport data bus Lbus 103 connects to data registers in data unit 110. Alocal bus temporary holding register LTD 104 is also connected to localport data Lbus 103.

Global port source data bus Gsrc 105 and global port destination databus Gdst 107 mediate global data transfers. These global data transfersmay be either memory accesses, register to register moves or commandword transfers between processors. Global port source data bus Gsrc 105carries 32 bit source information of a global port data transfer. Thedata source can be any of the registers of digital image/graphicsprocessor 71 or any data or parameter memory corresponding to any of thedigital image/graphics processors 71, 72, 73 or 74. The data is storedto memory via the global port 145. Multiplexer buffer 146 selects linesfrom local port data Lbus 103 or global port source data bus Gsrc 105,and performs data alignment. Multiplexer buffer 146 writes this dataonto global port data bus 148 for application to memory via crossbar 50.Global port source data bus Gsrc 105 also supplies data to data unit110, allowing the data of global port source data bus Gsrc 105 to beused as one of the arithmetic logic unit sources. This latter connectionallows any register of digital image/graphics processor 71 to be asource for an arithmetic logic unit operation.

Global port destination data bus Gdst 107 carries 32 bit destinationdata of a global bus data transfer. The destination is any register ofdigital image/graphics processor 71. Buffer 147 in global port 145sources the data of global port destination data bus Gdst 107. Buffer147 performs any needed data extraction and sign extension operations.This buffer 147 operates if the data source is memory, and a load isthus being performed. The arithmetic logic unit result serves as analternative data source for global port destination data bus Gdst 107.This allows any register of digital image/graphics processor 71 to bethe destination of an arithmetic logic unit operation. A global bustemporary holding register GTD 108 is also connected to global portdestination data bus Gdst 107.

Circuitry including multiplexer buffers 143 and 146 connect betweenglobal port source data bus Gsrc 105 and global port destination databus Gdst 107 to provide register to register moves. This allows a readfrom any register of digital image/graphics processor 71 onto globalport source data bus Gsrc 105 to be written to any register of digitalimage/graphics processor 71 via global port destination data bus Gdst107.

Note that it is advantageously possible to perform a load of anyregister of digital image/graphics processor 71 from memory via globalport destination data bus Gdst 107, while simultaneously sourcing thearithmetic logic unit in data unit 110 from any register via global portsource data bus Gsrc 105. Similarly, it is advantageously possible tostore the data in any register of digital image/graphics processor 71 tomemory via global port source data bus Gsrc 105, while saving the resultof an arithmetic logic unit operation to any register of digitalimage/graphics processor 71 via global port destination data bus Gdst107. The usefulness of these data transfers will be further detailedbelow.

Program flow control unit 130 receives the instruction words fetchedfrom instruction cache memory 21 via instruction bus 132. This fetchedinstruction word is advantageously stored in two 64 bit instructionregisters designated instruction register-address stage IRA 751 andinstruction register-execute stage IRE 752. Each of the instructionregisters IRA and IRE have their contents decoded and distributed.Digital image/graphics processor 71 includes opcode bus 133 that carriesdecoded or partially decoded instruction contents to data unit 110 andaddress unit 120. As will be later described, an instruction word mayinclude a 32 bit, a 15 bit or a 3 bit immediate field. Program flowcontrol unit 130 routes such an immediate field to global port sourcedata bus Gsrc 105 for supply to its destination.

Digital image/graphics processor 71 includes three address buses 121,122 and 131. Address unit 120 generates addresses on global port addressbus 121 and local port address bus 122. As will be further detailedbelow, address unit 120 includes separate global and local addressunits, which provide the addresses on global port address bus 121 andlocal port address bus 122, respectively. Note that local address unit620 may access memory other than the data memory corresponding to thatdigital image/graphics processor. In that event the local address unitaccess is via global port address bus 121. Program flow control unit 130sources the instruction address on instruction port address bus 131 froma combination of address bits from a program counter and cache controllogic. These address buses 121, 122 and 131 each carry address, bytestrobe and read/write information.

FIG. 5 illustrates details of data unit 110. It should be understoodthat FIG. 5 does not illustrate all of the connections of data unit 110.In particular various control lines and the like have been omitted forthe sake of clarity. Therefore FIG. 5 should be read with the followingdescription for a complete understanding of the operation of data unit110. Data unit 110 includes a number of parts advantageously operatingin parallel. Data unit 110 includes eight 32 bit data registers 200designated D7-D0. Data register D0 may be used as a general purposeregister but in addition has special functions when used with certaininstructions. Data registers 200 include multiple read and write portsconnected to data unit buses 201 to 206 and to local port data bus Lbus103, global port source data bus Gsrc 105 and global port destinationdata bus Gdst 107. Data registers 200 may also be read "sideways" in amanner described as a rotation register that will be further describedbelow. Data unit 110 further includes a status register 210 and amultiple flags register 211, which stores arithmetic logic unitresultant status for use in certain instructions. Data unit 110 includesas its major computational components a hardware multiplier 220 and athree input arithmetic logic unit 230. Lastly, data unit 110 includes:multiplier first input bus 201, multiplier second input bus 202,multiplier destination bus 203, arithmetic logic unit destination bus204, arithmetic logic unit first input bus 205, arithmetic logic unitsecond input bus 206; buffers 104, 106, 108 and 236; multiplexers Rmux221, Imux 222, MSmux 225, Bmux 227, Amux 232, Smux 231, Cmux 233 andMmux 234; and product left shifter 224, adder 226, barrel rotator 235,LMO/RMO/LMBC/RMBC circuit 237, expand circuit 238, mask generator 239,input A bus 241, input B bus 242, input C bus 243, rotate bus 244,function signal generator 245, bit 0 carry-in generator 246, andinstruction decode logic 250, all of which will be further describedbelow.

The following description of data unit 110 as well as furtherdescriptions of the use of each digital image/graphics processor 71, 72,73 and 74 employ several symbols for ease of expression. Many of thesesymbols are standard mathematical operations that need no explanation.Some are logical operations that will be familiar to one skilled in theart, but whose symbols may be unfamiliar. Lastly, some symbols refer tooperations unique to this invention. Table 1 lists some of these symbolsand their corresponding operation.

                  TABLE 1                                                         ______________________________________                                        Symbol          Operation                                                     ______________________________________                                        ˜         bit wise NOT                                                    & bit wise AND                                                                | bit wise OR                                                           bit wise exclusive OR                                                      @ multiple flags register expand                                              % mask generation                                                             %! modified mask generation                                                   \\ rotate left                                            << shift left                                                                 >>u shift right zero extend                                                   >>s shift right sign extend                                                   >> shift right sign extend                                                     default case                                                                 ∥ parallel operation                                                 *(A ± X) memory contents at                                                 address base register A ±                                                  index register X                                                              or offset X                                                                  &*(A ± X) address unit arithmetic                                           address base register A ±                                                  index register X                                                              or offset X                                                                  *(A ± [X]) memory contents at                                               address base register A ±                                                  scaled index register X                                                       or offset X                                                                ______________________________________                                    

The implications of the operations listed above in Table 1 may not beimmediately apparent. These will be explained in detail below.

FIG. 6 illustrates the field definitions for status register 210. Statusregister 210 may be read from via global port source data bus Gsrc 105or written into via global port destination data bus Gdst bus 107. Inaddition, status register 210 may write to or load from a specified oneof data registers 200. Status register 210 is employed in control ofoperations within data unit 110.

Status register 210 stores four arithmetic logic unit result status bits"N", "C", "V" and "Z". These are individually described below, butcollectively their setting behavior is as follows. Note that theinstruction types listed here will be fully described below. Forinstruction words including a 32 bit immediate fields, if the conditioncode field is "unconditional" then all four status bits are setaccording to the result of arithmetic logic unit 230. If the conditioncode field specifies a condition other than "unconditional", then nostatus bits are set, whether or not the condition is true. Forinstruction words not including a 32 bit immediate field operations andnot including conditional operations fields, all status bits are setaccording to the result of arithmetic logic unit 230. For instructionwords not including a 32 bit immediate field that permit conditionaloperations, if the condition field is "unconditional", or not"unconditional" and the condition is true, instruction word bits 28-25indicate which status bits should be protected. All unprotected bits areset according to the result of arithmetic logic unit 230. Forinstruction words not including a 32 bit immediate field, which allowconditional operations, if the condition field is not "unconditional"and the condition is false, no status bits are set. There is nodifference in the status setting behavior for Boolean operations andarithmetic operations. As will be further explained below, thisbehavior, allows the conditional instructions and source selection toperform operations that would normally require a branch.

The arithmetic logic unit result bits of status register 210 are asfollows. The "N" bit (bit 31) stores an indication of a negative result.The "N" bit is set to "1" if the result of the last operation ofarithmetic logic unit 230 was negative. This bit is loaded with bit 31of the result. In a multiple arithmetic logic unit operation, which willbe explained below, the "N" bit is set to the AND of the zero comparesof the plural sections of arithmetic logic unit 230. In a bit detectionoperation performed by LMO/RMO/LMBC/RMBC circuit 237, the "N" bit is setto the AND of the zero compares of the plural sections of arithmeticlogic unit 230. Writing to this bit in software overrides the normalarithmetic logic unit result writing logic.

The "C" bit (bit 30) stores an indication of a carry result. The "C" bitis set to "1" if the result of the last operation of arithmetic logicunit 230 caused a carry-out from bit 31 of the arithmetic logic unit.During multiple arithmetic and bit detection, the "C" bit is set to theOR of the carry outs of the plural sections of arithmetic logic unit230. Thus the "C" bit is set to "1" if at least one of the sections hasa carry out. Writing to this bit in software overrides the normalarithmetic logic unit result writing logic.

The "V" bit (bit 29) stores an indication of an overflow result. The "V"bit is set to "1" if the result of the last operation of arithmeticlogic unit 230 created an overflow condition. This bit is loaded withthe exclusive OR of the carry-in and carry-out of bit 31 of thearithmetic logic unit 230. During multiple arithmetic logic unitoperation the "V" bit is the AND of the carry outs of the pluralsections of arithmetic logic unit 230. For left most one and right mostone bit detection, the "V" bit is set to "1" if there were no "1's" inthe input word, otherwise the "V" bit is set to "0". For left most bitchange and right most bit change bit detection, the "V" bit is set to"1" is all the bits of the input are the same, or else the "V" bit isset to "0". Writing to this bit in software overrides the normalarithmetic logic unit result writing logic.

The "Z" bit (bit 28) stores and indication of a "0" result. The "Z" bitis set to "1" if the result of the last operation of arithmetic logicunit 230 produces a "0" result. This "Z" bit is controlled for botharithmetic operations and logical operations. In multiple arithmetic andbit detection operations, the "Z" bit is set to the OR of the zerocompares of the plural sections of arithmetic logic unit 230. Writing tothis bit in software overrides the normal arithmetic logic unit resultwriting logic circuitry.

The "R" bit (bit 6) controls bits used by expand circuit 238 androtation of multiple flags register 211 during instructions that useexpand circuit 238 to expand portions of multiple flags register 211. Ifthe "R" bit is "1", then the bits used in an expansion of multiple flagsregister 211 via expand circuit 238 are the most significant bits. Foran operation involving expansion of multiple flags register 211 wherethe arithmetic logic unit function modifier does not specify multipleflags register rotation, then multiple flags register 211 is"post-rotated left" according to the "Msize" field. If the arithmeticlogic unit function modifier does specify multiple flags registerrotation, then multiple flags register 211 is rotated according to the"Asize" field. If the "R" bit is "0", then expand circuit 238 employsthe least significant bits of multiple flags register 211. No rotationtakes place according to the "Msize" field. However, the arithmeticlogic unit function modifier may specify rotation by the "Asize" field.

The "Msize" field (bits 5-3) indicates the data size employed in certaininstruction classes that supply mask data from multiple flags register211 to the C-port of arithmetic logic unit 230. The "Msize" fielddetermines how many bits of multiple flags register 211 uses to createthe mask information. When the instruction does not specify rotationcorresponding to the "Asize" field and the "R" bit is "1", then multipleflags register 211 is automatically "post-rotated left" by an amount setby the "Msize" field. Codings for these bits are shown in Table 2.

                  TABLE 2                                                         ______________________________________                                        Msize     Data    Multiple Flags Register                                     Field     Size    Rotate   No. of Bit(s) used                                 5    4     3      bits  amount bits used                                                                            R = 1  R = 0                            ______________________________________                                        0    0     0      0     64     64     --     --                                 0 0 1 1 32 32 31-0  31-0                                                      0 1 0 2 16 16 31-16 15-0                                                      0 1 1 4 8 8 31-24 7-0                                                         1 0 0 8 4 4 31-28 3-0                                                         1 0 1 16 2 2 31-30 1-0                                                        1 1 0 32 1 1 31 0                                                             1 1 1 64 0 0 -- --                                                          ______________________________________                                    

As noted above, the preferred embodiment supports "Msize" fields of"100", "101" and "110" corresponding to data sizes of 8, 16 and 32 bits,respectively. Note that rotation for an "Msize" field of "001" resultsin no change in data output. "Msize" fields of "001", "010" and "011"are possible useful alternatives. "Msize" fields of "000", and "111" aremeaningless but may be used in an extension of multiple flags register211 to 64 bits.

The "Asize" field (bits 2-0) indicate the data size for multipleoperations performed by arithmetic logic unit 230. Arithmetic logic unit230 preferably includes 32 parallel bits. During certain instructionsarithmetic logic unit 230 splits into multiple independent sections.This is called a multiple arithmetic logic unit operation. Thissplitting of arithmetic logic unit 230 permits parallel operation onpixels of less than 32 bits that are packed into 32 bit data words. Inthe preferred embodiment arithmetic logic unit 230 supports: a single 32bit operation; two sections of 16 bit operations; and four sections of 8bit operations. These options are called word, half-word and byteoperations.

The "Asize" field indicates: the number of multiple sections ofarithmetic logic unit 230; the number of bits of multiple flags registerbits 211 set during the arithmetic logic unit operation, which is equalin number to the number of sections of arithmetic logic unit 230; andthe number of bits the multiple flags register should "post-rotate left"after output during multiple arithmetic logic unit operation. Therotation amount specified by the "Asize" field dominates over therotation amount specified by the "Msize" field and the "R" bit when thearithmetic logic unit function modifier indicates multiple arithmeticwith rotation. Codings for these bits are shown in Table 3. Note thatwhile the current preferred embodiment of the invention supportsmultiple arithmetic of one 32 bit section, two 16 bit sections and four8 bit sections the coding of the "Asize" field supports specification ofeight sections of 4 bits each, sixteen sections of 2 bits each andthirty-two sections of 1 bit each. Each of these additional sectiondivisions of arithmetic logic unit 230 are feasible. Note also that thecoding of the "Asize" field further supports specification of a 64 bitdata size for possible extension of multiple flags register 211 to 64bits.

                  TABLE 3                                                         ______________________________________                                        Asize        Data   Multiple Flags Register                                   Field        Size   Rotate    No. of Bits(s)                                  2      1     0       bits amount  bits set                                                                             set                                  ______________________________________                                        0      0     0       0    64      64     --                                     0 0 1 1 32 32 31-0                                                            0 1 0 2 16 16 15-0                                                            0 1 1 4 8 8 7-0                                                               1 0 0 8 4 4 3-0                                                               1 0 1 16 2 2 1-0                                                              1 1 0 32 1 1 0                                                                1 1 1 64 0 0 --                                                             ______________________________________                                    

The "Msize" and "Asize" fields of status register 210 control differentoperations. When using the multiple flags register 211 as a source forproducing a mask applied to the C-port of arithmetic logic unit 230, the"Msize" field controls the number of bits used and the rotate amount. Insuch a case the "R" bit determines whether the most significant bits orleast significant bits are employed. When using the multiple flagsregister 211 as a destination for the status bits corresponding tosections of arithmetic logic unit 230, then the "Asize" field controlsthe number and identity of the bits loaded and the optional rotateamount. If a multiple arithmetic logic unit operation with "Asize" fieldspecified rotation is specified with an instruction that supplies maskdata to the C-port derived from multiple flags register 211, then therotate amount of the "Asize" field dominates over the rotate amount ofthe combination of the "R" bit and the "Msize" field.

The multiple flags register 211 is a 32 bit register that provides maskinformation to the C-port of arithmetic logic unit 230 for certaininstructions. Global port destination data bus Gdst bus 107 may write tomultiple flags register 211. Global port source bus Gsrc may read datafrom multiple flags register 211. In addition multiple arithmetic logicunit operations may write to multiple flags register 211. In this casemultiple flags register 211 records either the carry or zero statusinformation of the independent sections of arithmetic logic unit 230.The instruction executed controls whether the carry or zero is stored.

The "Msize" field of status register 210 controls the number of leastsignificant bits used from multiple flags register 211. This number isgiven in Table 2 above. The "R" bit of status register 210 controlswhether multiple flags register 211 is pre-rotated left prior to supplyof these bits. The value of the "Msize" field determines the amount ofrotation if the "R" bit is "1". The selected data supplies expandcircuit 238, which generates a 32 bit mask as detailed below.

The "Asize" field of status register 210 controls the data stored inmultiple flags register 211 during multiple arithmetic logic unitoperations. As previously described, in the preferred embodimentarithmetic logic unit 230 may be used in one, two or four separatesections employing data of 32 bits, 16 bits and 8 bits, respectively.Upon execution of a multiple arithmetic logic unit operation, the"Asize" field indicates through the defined data size the number of bitsof multiple flags register 211 used to record the status information ofeach separate result of the arithmetic logic unit. The bit setting ofmultiple flags register 211 is summarized in Table 4.

                  TABLE 4                                                         ______________________________________                                        Data  ALU carry-out bits                                                                          ALU result bits equal to                                    Size setting MF bits zero setting MF bits                                   bits  3     2      1   0    3     2      1     0                              ______________________________________                                         8    31    23     15  7    31-24 23-16  15-8   7-0                             16 -- -- 31 15 -- -- 31-16 15-0                                               32 -- -- -- 31  -- -- -- 31-0                                               ______________________________________                                    

Note that Table 4 covers only the cases for data sizes of 8, 16 and 32bits. Those skilled in the art would easily realize how to extend Table4 to cover the cases of data sizes of 64 bits, 4 bits, 2 bits and 1 bit.Also note that the previous discussion referred to storing either carryor zero status in multiple flags register 211. It is also feasible tostore other status bits such as negative and overflow.

Multiple flags register 211 may be rotated left a number of bitpositions upon execution of each arithmetic logic unit operation. Therotate amount is given above. When performing multiple arithmetic logicunit operations, the result status bit setting dominates over the rotatefor those bits that are being set. When performing multiple arithmeticlogic unit operations, an alternative to rotation is to clear all thebits of multiple flags register 211 not being set by the result status.This clearing is after generation of the mask data if mask data is usedin that instruction. If multiple flags register 211 is written bysoftware at the same time as recording an arithmetic logic unit result,then the preferred operation is for the software write to load all thebits. Software writes thus dominate over rotation and clearing ofmultiple flags register 211.

FIG. 7 illustrates the splitting of arithmetic logic unit 230 intomultiple sections. As illustrated in FIG. 7, the 32 bits of arithmeticlogic unit 230 are separated into four sections of eight bits each.Section 301 includes arithmetic logic unit bits 7-0, section 302includes bits 15-8, section 303 includes bits 23-16 and section 304includes bits 31-24. Note that FIG. 7 does not illustrate the inputs oroutputs of these sections, which are conventional, for the sake ofclarity. The carry paths within each of the sections 301, 302, 303 and303 are according to the known art.

Multiplexers 311, 312 and 313 control the carry path between sections301, 302, 303 and 304. Each of these multiplexers is controlled toselect one of three inputs. The first input is a carry look ahead pathfrom the output of the previous multiplexer, or in the case of the firstmultiplexer 311 from bit 0 carry-in generator 246. Such carry look aheadpaths and their use are known in the art and will not be furtherdescribed here. The second selection is the carry-out from the last bitof the corresponding section of arithmetic logic unit 230. The finalselection is the carry-in signal from bit 0 carry-in generator 246.Multiplexer 314 controls the output carry path for arithmetic logic unit230. Multiplexer 314 selects either the carry look ahead path from thecarry-out selected by multiplexer 313 or the carry-out signal for bit 31from section 304.

Multiplexers 311, 312, 313 and 314 are controlled based upon theselected data size. In the normal case arithmetic logic unit 230operates on 32 bit data words. This is indicated by an "Asize" field ofstatus register 210 equal to "110". In this case multiplexer 311 selectsthe carry-out from bit 7, multiplexer 312 selects the carry-out from bit15, multiplexer 313 selects the carry-out from bit 23 and multiplexer314 selects the carry-out from bit 31. Thus the four sections 301, 302,303 and 304 are connected together into a single 32 bit arithmetic logicunit. If status register 210 selected a half-word via an "Asize" fieldof "101", then multiplexer 311 selects the carry-out from bit 7,multiplexer 312 selects the carry-in from bit 0 carry-in generator 246,multiplexer 313 selects the carry-out from bit 23 and multiplexer 314selects the carry-out from bit 31. Sections 301 and 302 are connectedinto a 16 bit unit and sections 303 and 304 are connected into a 16 bitunit. Note that multiplexer 312 selects the bit 0 carry-in signal forbit 16 just like bit 0, because bit 16 is the first bit in a 16 bithalf-word. If status register 210 selected a byte via an "Asize" fieldof "100", then multiplexers 311, 312 and 313 select the carry-in frombit 0 carry-in generator 246. Sections 301, 302, 303 and 304 are splitinto four independent 8 bit units. Note that selection of the bit 0carry-in signal at each multiplexer is proper because bits 8, 16 and 24are each the first bit in an 8 bit byte.

FIG. 7 further illustrates zero resultant detection. Each 8 bit zerodetect circuit 321, 322, 323 and 324 generates a "1" output if theresultant from the corresponding 8 bit section is all zeros "00000000".AND gate 331 is connected to 8 bit zero detect circuits 321 and 322,thus generating a "1" when all sixteen bits 15-0 are "0". AND gate 332is similarly connected to 8 bit zero detect circuits 321 and 322 forgenerating a "1" when all sixteen bits 31-16 are "0". Lastly, AND gate341 is connected to AND gates 331 and 332, and generates a "1" when all32 bits 31-0 are "0".

During multiple arithmetic logic unit operations multiple flags register211 may store either carry-outs or the zero comparison, depending on theinstruction. These stored resultants control masks to the C-port duringlater operations. Table 4 shows the source for the status bits stored.In the case in which multiple flags register 211 stores the carry-outsignal(s), the "Asize" field of status register 210 determines theidentity and number of carry-out signals stored. If the "Asize" fieldspecifies word operations, then multiple flags register 211 stores asingle bit equal to the carry-out signal of bit 31. If the "Asize" fieldspecifies half-word operations, then multiple flags register 211 storestwo bits equal to the carry-out signals of bits 31 and 15, respectfully.If the "Asize" field specifies byte operations, then multiple flagsregister 211 stores four bits equal to the carry-out signals of bits 31,23, 15 and 7, respectively. The "Asize" field similarly controls thenumber and identity of zero resultants stored in multiple flags register211 when storage of zero resultants is selected. If the "Asize" fieldspecifies word operations, then multiple flags register 211 stores asingle bit equal to output of AND gate 341 indicating if bits 31-0 are"0". If the "Asize" field specifies half-word operations, then multipleflags register 211 stores two bits equal to the outputs of AND gates 331and 332, respectfully. If the "Asize" field specifies byte operations,then multiple flags register 211 stores four bits equal to the outputsof 8 bit zero detect circuits 321, 322, 323 and 324, respectively.

It is technically feasible and within the scope of this invention toallow further multiple operations of arithmetic logic unit 230 such as:eight sections of 4 bit operations; sixteen sections 2 bit operations;and thirty-two sections single bit operations. Note that both the"Msize" and the "Asize" fields of status register 210 include coding tosupport such additional multiple operation types. Those skilled in theart can easily modify and extend the circuits illustrated in FIG. 7using additional multiplexers and AND gates. These latter feasibleoptions are not supported in the preferred embodiment due to the addedcomplexity in construction of arithmetic logic unit 230. Note also thatthis technique can be extended to a data processing apparatus employing64 bit data and that the same teachings enable such an extension.

Data registers 200, designated data registers D7-D0 are connected tolocal port data bus Lbus 103, global port source data bus Gsrc 105 andglobal port destination data bus Gdst 107. Arrows within the rectanglerepresenting data registers 200 indicate the directions of data access.A left pointing arrow indicates data recalled from data registers 200. Aright pointing arrow indicates data written into data registers 200.Local port data bus Lbus 103 is bidirectionally coupled to dataregisters 200 as a data source or data destination. Global portdestination data bus Gdst 107 is connected to data registers 200 as adata source for data written into data registers 200. Global port sourcedata bus Gsrc 107 is connected to data registers 200 as a datadestination for data recalled from data registers 200 in both a normaldata register mode and in a rotation register feature described below.Status register 210 and multiple flags register 211 may be read from viaglobal port source data bus Gsrc 106 and written into via global portdestination data bus Gdst 107. Data registers 200 supply data tomultiplier first input bus 201, multiplier second input bus 202,arithmetic logic unit first input bus 205 and arithmetic logic unitsecond input bus 206. Data registers 200 are connected to receive inputdata from multiplier destination bus 203 and arithmetic logic unitdestination bus 204.

Data registers 200, designated registers D7-D0, are connected to form a256 bit rotate register as illustrated in FIG. 8. This rotate registeris collectively designated rotation (ROT) register ROT 208. This forms a256 bit register comprising eight 32 bit rotation registers ROT0, ROT1,. . . ROT7. FIG. 8 illustrates in part the definitions of the rotationregisters ROT0, ROT1, . . . ROT7. These rotation registers are definedsideways with respect to data registers D7-D0. The rotation register 208may be rotated by a non-arithmetic logic unit instruction DROT, asdescribed below. During this rotation the least significant bit of dataregister D7 rotates into the most significant bit of data register D6,etc. The least significant bit of data register D0 is connected back tothe most significant bit of data register D7. ROT register 208 may beread in four 8 bit bytes at a time. The four 8 bit bytes are respectiveoctets of bits having the same bit number in each of data registers 200as shown below in Table 5 and illustrated in FIG. 8.

                  TABLE 5                                                         ______________________________________                                               Rotation                                                                             Octet of bits                                                     Register from each                                                            bits D7-D0 Bit                                                              ______________________________________                                               31-24  24                                                                23-16 16                                                                      15-8   8                                                                      7-0  0                                                                      ______________________________________                                    

When a DROT instruction is executed the 256 bit rotation register 208 isrotated right one bit place. The least significant bit 0 of each byte A,B, C, D of each register such as D7 is mapped as shown to a particularbit number of the ROT register output onto the global port source databus Gsrc 105. ROT register 208 is read only in the preferred embodiment,but can be writable in other embodiments.

ROT register 208 is useful in image rotations, orthogonal transforms andmirror transforms. Performing 32 bit stores to memory from the rotationregister 208 in parallel with eight DROT instructions rotates four 8 by8 bit patches of data clockwise ninety degrees. The rotated data isstored in the target memory locations. Various combinations of registerloading, memory address storing, and data size alteration, can enable avariety of clockwise and counter-clockwise rotations of 8 by 8 bitpatches to be performed. Rotation of larger areas can then be performedby moving whole bytes. This remarkable orthogonal structure thatprovides register file access to registers D7-D0 in one mode, androtation register access in the DROT operation, is only slightly morecomplex than a register file alone.

The data register D0 has a dual function. It may be used as a normaldata register in the same manner as the other data registers D7-D1. Dataregister D0 may also define certain special functions when executingsome instructions. Some of the bits of the most significant half-word ofdata register D0 specifies the operation of all types of extendedarithmetic logic unit operations. Some of the bits of the leastsignificant half-word of data register D0 specifies multiplier optionsduring a multiple multiply operation. The 5 least significant bits ofdata register D0 specify a default barrel rotate amount used by certaininstruction classes. FIG. 9 illustrates the contents of data register D0when specifying data unit 110 operation.

The "FMOD" field (bits 31-28) of data register D0 allow modification ofthe basic operation of arithmetic logic unit 230 when executing aninstruction calling for an extended arithmetic logic unit (EALU)operation. Table 6 illustrates these modifier options. Note, asindicated in Table 6, certain instruction word bits in some instructionformats are decoded as function modifiers in the same fashion. Thesewill be further discussed below.

                  TABLE 6                                                         ______________________________________                                        Function                                                                        Modifier                                                                      Code Modification Performed                                                 ______________________________________                                        0   0     0     0   normal operation                                            0 0 0 1 cin                                                                   0 0 1 0 %! if mask generation instruction                                         LMO if not mask generation instruction                                    0 0 1 1 (%! and cin) if mask generation instruction                               RMO if not mask generation instruction                                    0 1 0 0 A-port = 0                                                            0 1 0 1 A-port = 0 and cin                                                    0 1 1 0 (A-port = 0 and %!) if mask generation instruction                        LMBC if not mask generation instruction                                   0 1 1 1 (A-port = 0 and %! and cin) if mask generation                            instruction                                                                   RMBC if not mask generation instruction                                   1 0 0 0 Multiple arithmetic logic unit operations,                                carry-out(s) -> multiple flags register                                   1 0 0 1 Multiple arithmetic logic unit operations,                                zero result(s) -> multiple flags register                                 1 0 1 0 Multiple arithmetic logic unit operations,                                carry-out(s) -> multiple flags register,                                      rotate by "Asize" field of status register                                1 0 1 1 Multiple arithmetic logic unit operations,                                zero result(s) -> multiple flags register,                                    rotate by "Asize" field of status register                                1 1 0 0 Multiple arithmetic logic unit operations,                                carry-out(s) -> multiple flags register,                                      clear multiple flags register                                             1 1 0 1 Multiple arithmetic logic unit operations,                                zero result(s) -> multiple flags register,                                    clear multiple flags register                                             1 1 1 0 Reserved                                                              1 1 1 1 Reserved                                                            ______________________________________                                                              Instruction word bit                                                                     Data Register D0 bit                         ______________________________________                                          52 28                                                                         54 29                                                                         56 30                                                                         58 31                                                                       ______________________________________                                    

The modified operations listed in Table 6 are explained below. If the"FMOD" field is "0000", the normal, unmodified operation results. Themodification "cin" causes the carry-in to bit 0 of arithmetic logic unit230 to be the "C" bit of status register 210. This allows add withcarry, subtract with borrow and negate with borrow operations. Themodification "%!" works with mask generation. When the "%!" modificationis active mask generator 239 effectively generates all "1's" for a zerorotate amount rather than all "0's". This function can be implemented bychanging the mask generated by mask generator 239 or by modifying thefunction of arithmetic logic unit 230 so that mask of all "0's" suppliedto the C-port operates as if all "1's" were supplied. This modificationis useful in some rotate operations. The modifications "LMO", "RMO","LMBC" and "RMBC" designate controls of the LMO/RMO/LMBC/RMBC circuit237. The modification "LMO" finds the left most "1" of the secondarithmetic input. The modification "RMO" finds the right most "1". Themodification "LMBC" finds the left most bit that differs from the signbit (bit 31). The "RMBC" modification finds the right most bit thatdiffers from the first bit (bit 0). Note that these modifications areonly relevant if the C-port of arithmetic logic unit 230 does notreceive a mask from mask generator 239. The modification "A-port=0"indicates that the input to the A-port of arithmetic logic unit 230 iseffectively zeroed. This may take place via multiplexer Amux 232providing a zero output, or the operation of arithmetic logic unit 230may be altered in a manner having the same effect. An "A-port=0"modification is used in certain negation, absolute value and shift rightoperations. A "multiple arithmetic logic unit operation" modificationindicates that one or more of the carry paths of arithmetic logic unit230 are severed, forming in effect two or more independent arithmeticlogic units operating in parallel. The "Asize" field of status register210 controls the number of such multiple arithmetic logic unit sections.The multiple flags register 211 stores a number of status bits equal tothe number of sections of the multiple arithmetic logic unit operations.In the "carry-out(s)→multiple flags" modification, the carry-out bit orbits are stored in multiple flags register 211. In the "zeroresult(s)→multiple flags" modification, an indication of the zeroresultant for the corresponding arithmetic logic unit section is storedin multiple flags register 211. This process is described above togetherwith the description of multiple flags register 211. During this storingoperation, bits within multiple flags register 211 may be rotated inresponse to the "rotate" modification or cleared in response to the"clear" modification. These options are discussed above together withthe description of multiple flags register 211.

The "A" bit (bit 27) of data register D0 controls whether arithmeticlogic unit 230 performs an arithmetic or Boolean logic operation duringan extended arithmetic logic unit operation. This bit is called thearithmetic enable bit. If the "A" bit is "1", then an arithmeticoperation is performed. If the "A" bit is "0", then a logic operation isperformed. If the "A" bit is "0", then the carry-in from bit 0 carry-ingenerator 246 into bit 0 of the arithmetic logic unit 230 is generally"0". As will be further explained below, certain extended arithmeticlogic unit operations may have a carry-in bit of "1" even when the "A"bit is "0" indicating a logic operation.

The "EALU" field (bits 19-26) of data register D0 defines an extendedarithmetic logic unit operation. The eight bits of the "EALU" fieldspecify the arithmetic logic unit function control bits used in alltypes of extended arithmetic logic unit operations. These bits becomethe control signals to arithmetic logic unit 230. They may be passed toarithmetic logic unit 230 directly, or modified according to the "FMOD"field. In some instructions the bits of the "EALU" field are inverted,leading to an "EALUF" or extended arithmetic logic unit false operation.In this case the eight control bits supplied to arithmetic logic unit230 are inverted.

The "C" bit (bit 18) of data register D0 designates the carry-in to bit0 of arithmetic logic unit 230 during extended arithmetic logic unitoperations. The carry-in value into bit 0 of the arithmetic logic unitduring extended arithmetic logic unit operations is given by this "C"bit. This allows the carry-in value to be specified directly, ratherthan by a formula as for non-EALU operations.

The "I" bit (bit 17) of data register D0 is designated the invertcarry-in bit. The "I" bit, together with the "C" bit and the "S" bit(defined below), determines whether or not to invert the carry-in intobit 0 of arithmetic logic unit 230 when the function code of anarithmetic logic unit operation are inverted. This will be furtherdetailed below.

The "S" bit (bit 16) of data register D0 indicates selection of signextend. The "S" bit is used when executing extended arithmetic logicunit operations ("A" bit=1). If the "S" bit is "1", then arithmeticlogic unit control signals F3-F0 (produced from bits 22-19) should beinverted if the sign bit (bit 31) of the data first arithmetic logicunit input bus 206 is "0", and not inverted if this sign bit is "1". Theeffect of conditionally inverting arithmetic logic unit control signalsF3-F0 will be explained below. Such an inversion is useful to signextend a rotated input in certain arithmetic operations. If the extendedarithmetic logic unit operation is Boolean ("A" bit=0), then the "S" bitis ignored and the arithmetic logic unit control signals F3-F0 areunchanged.

Table 7 illustrates the interaction of the "C", "I" and "S" bits of dataregister D0. Note that an "X" entry for either the "I" bit or the firstinput sign indicates that bit does not control the outcome, i.e. a"don't care" condition.

                  TABLE 7                                                         ______________________________________                                        S       I     First Input Sign                                                                           Invert C?                                                                            Invert F3-F0                                ______________________________________                                        0       X     X            no     no                                            1 0 0 no no                                                                   1 0 1 no yes                                                                  1 1 0 no no                                                                   1 1 1 yes yes                                                               ______________________________________                                    

If the "S" bit equals "1" and the sign bit of the first input destinedfor the B-port of arithmetic logic unit 230 equals "0", then the valueof the carry-in to bit 0 of arithmetic logic unit 230 set by the "C" bitvalue can optionally be inverted according to the value of the "I" bit.This allows the carry-in to be optionally inverted or not, based on thesign of the input. Note also that arithmetic logic unit control signalsF3-F0 are optionally inverted based on the sign of the input, if the "S"bit is "1". This selection of inversion of arithmetic logic unit controlsignals F3-F0 may be overridden by the "FMOD" field. If the "FMOD" fieldspecifies "Carry-in=Status Register's Carry bit", then the carry-inequals the "C" bit of status register 210 whatever the value of the "S"and "I" bits. Note also that the carry-in for bit 0 of arithmetic logicunit 230 may be set to "1" via the "C" bit for extended arithmetic logicunit operations even if the "A" bit is "0" indicating a Booleanoperation.

The "N" bit (bit 15) of data register D0 is used when executing a splitor multiple section arithmetic logic unit operation. This "N" bit iscalled the non-multiple mask bit. For some extended arithmetic logicunit operations that specify multiple operation via the "FMOD" field,the instruction specifies a mask to be passed to the C-port ofarithmetic logic unit 230 via mask generator 239. This "N" bitdetermines whether or not the mask is split into the same number ofsections as arithmetic logic unit 230. Recall that the number of suchmultiple sections is set by the "Asize" field of status register 210. Ifthe "N" bit is "0", then the mask is split into multiple masks. If the"N" bit is "1", then mask generator 239 produces a single 32 bit mask.

The "E" bit (bit 14) designates an explicit multiple carry-in. This bitpermits the carry-in to be specified at run time by the input to theC-port of arithmetic logic unit 230. If both the "A" bit and the "E" bitare "1" and the "FMOD" field does not designate the cin function, thenthe effects of the "S", "I" and "C" bits are annulled. The carry inputto each section during multiple arithmetic is taken as the exclusive ORof the least significant bit of the corresponding section input to theC-port and the function signal F0. If multiple arithmetic is notselected the single carry-in to bit 0 of arithmetic logic unit 230 isthe exclusive OR of the least significant bit (bit 0) the input to theC-port and the function signal F0. This is particularly useful forperforming multiple arithmetic in which differing functions areperformed in different sections. One extended arithmetic logic unitoperation corresponds to (A B)&C | (A ˜B)&C. Using a mask for the C-portinput, a section with all "0's" produces addition with the propercarry-in of "0" and a section of all "1's" produces subtraction with theproper carry-in of "1".

The "DMS" field (bits 12-8) of data register D0 defines the shiftfollowing the multiplier. This shift takes place in product left shifter224 prior to saving the result or passing the result to rounding logic.During this left shift the most significant bits shifted out arediscarded and zeroes are shifted into the least significant bits. The"DMS" field is effective during any multiply/extended arithmetic logicunit operation. In the preferred embodiment data register D0 bits 9-8select 0, 1, 2 or 3 place left shifting. Table 8 illustrates thedecoding.

                  TABLE 8                                                         ______________________________________                                        DMS field                                                                     9            8     Left shift amount                                          ______________________________________                                        0            0     0                                                            0 1 1                                                                         1 0 2                                                                         1 1 3                                                                       ______________________________________                                    

The "DMS" field includes 5 bits that can designate left shift amountsfrom 0 to 31 places. In the preferred embodiment product left shifter224 is limited to shifts from 0 to 3 places for reasons of size andcomplexity. Thus bits 12-10 of data register D0 are ignored in settingthe left shift amount. However, it is feasible to provide a left shiftamount within the full range from 0 to 31 places from the "DMS" field ifdesired.

The "M" bit (bit 7) of data register D0 indicates a multiple multiplyoperation. Multiplier 220 can multiply two 16 bit numbers to generate a32 bit result or of simultaneously multiplying two pair of 8 bit numbersto generate a pair of 16 bit resultants. This "M" bit selects either asingle 16 by 16 multiply if "M"="0", or two 8 by 8 multiplies if"M"="1". This operation is similar to multiple arithmetic logic unitoperations and will be further described below.

The "R" bit (bit 6) of data register D0 specifies whether a roundingoperation takes place on the resultant from multiplier 220. If the "R"bit is 1 the a rounding operation, explained below together with theoperation of multiplier 220, takes place. If the "R" bit is "0", then norounding takes place and the 32 bit resultant form multiplier 220 iswritten into the destination register. Note that use of a predeterminedbit in data register D0 is merely a preferred embodiment for triggeringthis mode. It is equally feasible to enable the rounding mode via apredetermined instruction word bit.

The "DBR" field (bits 4-0) of data register D0 specifies a defaultbarrel rotate amount used barrel rotator 235 during certaininstructions. The "DBR" field specifies the number of bit positions thatbarrel rotator 235 rotates left. These 5 bits can specify a left rotateof 0 to 31 places. The value of the "DBR" field may also be supplied tomask generator 239 via multiplexer Mmux 234. Mask generator 239 forms amask supplied to the C-port of arithmetic logic unit 230. The operationof mask generator 239 will be discussed below.

Multiplier 220 is a hardware single cycle multiplier. As describedabove, multiplier 220 operates to multiply a pair of 16 bit numbers toobtain a 32 bit resultant or to multiply two pairs of 8 bit numbers toobtain two 16 bit resultants in the same 32 bit data word.

FIGS. 10a, 10b, 10c and 10d illustrate the input and output data formatsfor multiplying a pair of 16 bit numbers. FIG. 10a shows the format of asigned input. Bit 15 indicates the sign of this input, a "0" forpositive and a "1" for negative. Bits 0 to 14 are the magnitude of theinput. Bits 16 to 31 of the input are ignored by the multiply operationand are shown as a don't care "X". FIG. 10b illustrates the format ofthe resultant of a signed by signed multiply. Bits 31 and 30 are usuallythe same and indicate the sign of the resultant. If the multiplicationwas of Hex "8000" by Hex "8000", then bits 31 and 30 become "01". FIG.10c illustrates the format of an unsigned input. The magnitude isrepresented by bits 0 to 15, and bits 16 to 31 are don't care "X". FIG.10d shows the format of the resultant of an unsigned by unsignedmultiply. All 32 bits represent the resultant.

FIG. 11 illustrates the input and output data formats for multiplyingtwo pair of 8 bit numbers. In each of the two 8 bit by 8 bit multipliesthe two first inputs on multiplier first input bus 201 are alwaysunsigned. The second inputs on multiplier second input bus 202 may beboth signed, resulting in two signed products, or both unsigned,resulting in two unsigned products. FIG. 11a illustrates the format of apair of signed inputs. The first signed input occupies bits 0 to 7. Bit7 is the sign bit. The second signed input occupies bits 8 to 15, bit 15being the sign bit. FIG. 11b illustrates the format of a pair ofunsigned inputs. Bits 0 to 7 form the first unsigned input and bits 8 to16 form the second unsigned input. FIG. 11c illustrates the format of apair of signed resultants. As noted above, a dual unsigned by signedmultiply operation produces such a pair of signed resultants. The firstsigned resultant occupies bits 0 to 15 with bit 15 being the sign bit.The second signed resultant occupies bits 16 to 31 with bit 31 being thesign bit. FIG. 11d illustrates the format of a pair of unsignedresultants. The first unsigned resultant occupies bits 1 to 15 and thesecond unsigned resultant occupies bits 16 to 31.

Multiplier first input bus 201 is a 32 bit bus sourced from a dataregister within data registers 200 selected by the instruction word. The16 least significant bits of multiplier first input bus 201 supplies afirst 16 bit input to multiplier 220. The 16 most significant bits ofmultiplier first input bus 201 supplies the 16 least significant bits ofa first input to a 32 bit multiplexer Rmux 221. This data routing is thesame for both the 16 bit by 16 bit multiply and the dual 8 bit by 8 bitmultiply. The 5 least significant bits multiplier first input bus 201supply a first input to a multiplexer Smux 231.

Multiplier second input bus 202 is a 32 bit bus sourced from one of thedata registers 200 as selected by the instruction word or from a 32 bit,5 bit or 1 bit immediate value imbedded in the instruction word. Amultiplexer Imux 222 supplies such an immediate multiplier second inputbus 202 via a buffer 223. The instruction word controls multiplexer Imux222 to supply either 32 bits, 5 bits or 1 bit from an immediate field ofthe instruction word to multiplier second input bus 202 when executingan immediate instruction. The short immediate fields are zero extendedin multiplexer Imux 222 upon supply to multiplier second input bus 202.The 16 least significant bits of multiplier second input bus 202supplies a second 16 bit input to multiplier 220. This data routing isthe same for both the 16 bit by 16 bit multiply and the dual 8 bit by 8bit multiply. Multiplier second input bus 202 further supplies one inputto multiplexer Amux 232 and one input to multiplexer Cmux 233. The 5least significant bits of multiplier second input bus 202 supply oneinput to multiplexer Mmux 234 and a second input to multiplexer Smux231.

The output of multiplier 220 supplies the input of product left shifter224. Product left shifter 224 can provide a controllable left shift of3, 2, 1 or 0 bits. The output of multiply shift multiplexer MSmux 225controls the amount of left shift of product left shifter 224. Multiplyshift multiplexer MSmux 225 selects either bits 9-8 from the "DMS" fieldof data register D0 or all zeroes depending on the instruction word. Inthe preferred embodiment, multiply shift multiplexer MSmux 225 selectsthe "0" input for the instructions MPYx ∥ ADD and MPYx ∥ SUB. Theseinstructions combine signed or unsigned multiplication with addition orsubtractions using arithmetic logical unit 230. In the preferredembodiment, multiply shift multiplexer MSmux 225 selects bits 9-8 ofdata register D0 for the instructions MPYx ∥ EALUx. These instructionscombine signed or unsigned multiplication with one of two types ofextended arithmetic logic unit instructions using arithmetic logic unit230. The operation of data unit 110 when executing these instructionswill be further described below. Product left shifter 224 discards themost significant bits shifted out and fills the least significant bitsshifted in with zeros. Product left shifter 224 supplies a 32 bit outputconnected to a second input of multiplexer Rmux 221.

FIG. 12 illustrates internal circuits of multiplier 220 in block diagramform. The following description of multiplier 220 points out thedifferences in organization during 16 bit by 16 bit multiplies from thatduring dual 8 bit by 8 bit multiplies. Multiplier first input bus 201supplies a first data input to multiplier 220 and multiplier secondinput bus 202 supplies a second data input. Multiplier first input bus201 supplies 19 bit derived value circuit 350. Nineteen bit derivedvalue circuit 350 forms a 19 bit quantity from the 16 bit input.Nineteen bit derived value circuit 350 includes a control inputindicating whether multiplier 220 executes a single 16 bit by 16 bitmultiplication or dual 8 bit by 8 bit multiplication. Booth quadre-coder 351 receives the 19 bit value from 19 bit derived value circuit350 and forms control signals for six partial product generators 353,354, 356, 363, 364 and 366 (PPG5-PPG0). Booth quad re-coder 351 thuscontrols the core of multiplier 220 according to the first input orinputs on multiplier first input bus 201 for generating the desiredproduct or products.

FIGS. 13 and 14 schematically illustrate the operation of 19 bit derivedvalue circuit 350 and Booth quad re-coder 351. For all modes ofoperation, the 16 most significant bits of multiplier first input bus201 are ignored by multiplier 220. FIG. 13 illustrates the 19 bitderived value for 16 bit by 16 bit multiplications. The 16 bits of thefirst input are left shifted by one place and sign extended by twoplaces. In the unsigned mode, the sign is "0". Thus bits 18-17 of the 19bit derived value are the sign, bits 16-1 correspond to the 16 bitinput, and bit 0 is always "0". The resulting 19 bits are grouped intosix overlapping four-bit units to form the Booth quads. Bits 3-0 formthe first Booth quad controlling partial product generator PPG0 353,bits 6-3 control partial product generator PPG1 354, bits 9-6 controlpartial product generator PPG2 356, bits 12-9 control partial productgenerator PPG3 363, bits 15-12 control partial product generator PPG4364, and bits 18-15 control partial product generator PPG5 366. FIG. 14illustrates the 19 bit derived value for dual 8 bit by 8 bitmultiplications. The two inputs are pulled apart. The first input isleft shifted by one place, the second input is left shifted by twoplaces. Bits 0 and 9 of the 19 bit derived value are set to "0", bit 18to the sign. The Booth quads are generated in the same manner as in 16bit by 16 bit multiplication. Note that placing a "0" in bit 9 of thederived value makes the first three Booth quads independent of thesecond 8 bit input and the last three Booth quads independent of thefirst 8 bit input. This enables separation of the two products at themultiplier output.

The core of multiplier 220 includes: six partial product generators 353,354, 356, 363, 364 and 366, which are designated PPG0 to PPG5,respectively; five adders 355, 365, 357, 267 and 368, designated addersA, B, C, D and E; and an output multiplexer 369. Partial productgenerators 353, 354, 356, 363, 364 and 366 are identical. Each partialproduct generator 353, 354, 356, 363, 364 and 366 forms a partialproduct based upon a corresponding Booth quad. These partial productsare added to form the final product by adders 355, 365, 357, 367 and368.

The operation of partial product generator 353, 354, 356, 363, 364 and366 is detailed in Tables 9 and 10. Partial product generators 353, 354,356, 363, 364 and 366 multiply the input data derived from multipliersecond input bus 202 by integer amounts ranging from -4 to +4. Themultiply amounts for the partial product generators are based upon thevalue of the corresponding Booth quad. This relationship is shown inTable 9 below.

                  TABLE 9                                                         ______________________________________                                               Quad Multiply Amount                                                   ______________________________________                                               0000 0                                                                   0001 1                                                                        0010 1                                                                        0011 2                                                                        0100 2                                                                        0101 3                                                                        0110 3                                                                        0111 4                                                                        1000 -4                                                                       1001 -3                                                                       1010 -3                                                                       1011 -2                                                                       1100 -2                                                                       1101 -1                                                                       1110 -1                                                                       1111 -0                                                                     ______________________________________                                    

Table 10 lists the action taken by the partial product generator basedupon the desired multiply amount.

                  TABLE 10                                                        ______________________________________                                        Multiply        Partial Product                                                 Amount Generator Action                                                     ______________________________________                                        ±0           select all zeros                                                ±1 pass input straight through                                             ±2 shift left one place                                                    ±3 select output of 3x generator                                           ±4 shift left two places                                                 ______________________________________                                    

In most cases, the partial product is easily derived. An all "0" outputis selected for a multiply amount of 0. A multiply amount of 1 resultsin passing the input unchanged. Multiply amounts of 2 and 4 are donesimply by shifting. A dedicated piece of hardware generates the multipleof 3. This hardware essentially forms the addition of the input valueand the input left shifted one place.

Each partial product generator 353, 354, 356, 363, 364 and 366 receivesan input value based upon the data received on multiply second input bus202. The data on multiply second input bus 202 is 16 bits wide. Eachpartial product generator 353, 354, 356, 363, 364 and 366 needs to be 18bits to hold the 16 bit number shifted two places left, as in themultiply by 4 case. The output of each partial product generator 353,354, 356, 363, 364 and 366 is shifted three places left from that of thepreceding partial product generator 353, 354, 356, 363, 364 and 366.Thus each partial product generator output is weighted by 8 from itspredecessor. This is shown in FIG. 12, where bits 2-0 of each partialproduct generator 353, 354, 356, 363, 364 and 366 is handled separately.Note that adders A, B, C, D and E are always one bit wider than theirinput data to hold any overflow.

The adders 355, 357, 365, 367 and 368 used in the preferred embodimentemploy redundant-sign-digit notation. In the redundant-sign-digitnotation, a magnitude bit and a sign bit represents each bit of thenumber. This known format is useful in the speeding the additionoperation in a manner not important to this invention. However thisinvention is independent of the adder type used, so for simplicity thiswill not be further discussed. During multiply operations data from the16 least significant bits on multiply second input bus 202 is fed intoeach of the six partial product generator 353, 354, 356, 363, 364 and366, and multiplied by the amount determined by the corresponding Boothquad.

Second input multiplexer 352 determines the data supplied to the sixpartial produce generators 353, 354, 356, 363, 364 and 366. This datacomes from the 16 least significant bits on multiply second input bus202. The data supplied to partial products generators 353, 354, 356,363, 364 and 366 differ depending upon whether multiplier 220 executes asingle 16 bit by 16 bit multiplication or dual 8 bit by 8 bitmultiplication. FIG. 15 illustrates the second input data supplied tothe six partial produce generators 353, 354, 356, 363, 364 and 366during a 16 bit by 16 bit multiply. FIG. 15a illustrates the case ofunsigned multiplication. The 16 bit input is zero extended to 18 bits.FIG. 15b illustrates the case of signed multiplication. The data is signextended to 18 bits by duplicating the sign bit (bit 15). During 16 bitby 16 bit multiplication and of the six partial produce generators 353,354, 356, 363, 364 and 366 receives the same second input.

The six partial produce generators 353, 354, 356, 363, 364 and 366 donot receive the same second input during dual 8 bit by 8 bitmultiplication. Partial product generators 353, 345 and 356 receive oneinput and partial product generators 363, 364 and 366 receive another.This enables separation of the two inputs when operating in multiplemultiply mode. Note that in the multiple multiply mode there is nooverlap of second input data supplied to the first three partial productgenerators 353, 345 and 356 and the second three partial productgenerators 363, 364 and 366. FIG. 16 illustrates the second input datasupplied to the six partial produce generators 353, 354, 356, 363, 364and 366 during a dual 8 bit by 8 bit multiply. FIG. 16a illustrates thesecond input data supplied to partial product generators 353, 354 and356 for an unsigned input. FIG. 16a illustrates the input zero extendedto 18 bits. FIG. 16b illustrates the second input data supplied topartial product generators 353, 354 and 356 for a signed input, which issign extended to 18 bits. FIG. 16c illustrates the second input datasupplied to partial product generators 363, 364 and 366 for an unsignedinput. FIG. 16c illustrates the input at bits 15-8 with the other placesof the 18 bits set to "0". FIG. 16d illustrates the second input datasupplied to partial product generators 363, 364 and 366 for a signedinput. The 7 bit magnitude is at bits 14-8, bits 17-15 hold the sign andbits 7-0 are set to "0".

Note that it would be possible to have added the partial products ofpartial product generators 353, 354, 356, 363, 364 and 366 in series.The present embodiment illustrated in FIG. 12 has two advantages oversuch a series of additions. This embodiment offers significant speedadvantages by performing additions in parallel. This embodiment alsolends itself well to performing dual 8 bit by 8 bit multiplies.

These can be very useful in speeding data manipulation and datatransfers where an 8 bit by 8 bit product provides the data resolutionneeded.

A further multiplexer switches between the results of a 16 bit by 16 bitmultiply and dual 8 bit by 8 bit multiplies. Output multiplexer 369 iscontrolled by a signal indicating whether multiplier 220 executes asingle 16 bit by 16 bit multiplication or dual 8 bit by 8 bitmultiplication. FIG. 17 shows the derivation of each bit of theresultant. FIG. 17a illustrates the derivation of each bit for a 16 bitby 16 bit multiply. Bits 31-9 of the resultant come from bits 22-0 ofadder E 368, respectively. Bits 8-6 come from bits 2-0 of adder C 357,respectively. Bits 5-3 come from bits 2-0 of adder A 355, respectively.Bits 2-0 come from bits 2-0 of partial product generator 353. FIG. 17billustrates the derivation of each bit for the case of dual 8 bit by 8bit multiplication. Bits 31-16 of the resultant in this case come frombits 15-0 of adder D 367, respectively. Bits 15-6 of the resultant comefrom bits 9-0 of adder C 357 respectively. As in the case illustrated inFIG. 17a, bits 5-3 come from bits 2-0 of adder A 355 and bits 2-0 comefrom bits 2-0 of partial product generator 353.

It should be noted that in the actual implementation of outputmultiplexer 369 requires duplicated data paths to handle both themagnitude and sign required by the redundant-sign-digit notation. Thisduplication has not been shown or described in detail. Theredundant-sign-digit notation is not required to practice thisinvention, and those skilled in the art would easily realize how toconstruct output multiplexer 369 to achieve the desired result inredundant-sign-digit notation. Note also when using theredundant-sign-digit notation, the resultant generally needs to beconverted into standard binary notation before use by other parts ofdata unit 110. This conversion is known in the art and will not befurther described.

It can be seen from the above description that with the addition of asmall amount of logic the same basic hardware can perform 16 bit by 16multiplication and dual 8 bit by 8 bit multiplications. The additionalhardware consists of multiplexers at the two inputs to the multipliercore, a modification to the Booth re-coder logic and a multiplexer atthe output of the multiplier. This additional hardware permits muchgreater data through put when using dual 8 bit by 8 bit multiplication.

Adder 226 has three inputs. A first input is set to all zeros. A secondinput receives the 16 most significant bits (bits 31-16) of the leftshifted resultant of multiplier 220. A carry-in input receives theoutput of bit 15 of this left shifter resultant of multiplier 220.Multiplexer Rmux 221 selects either the entire 32 bit resultant ofmultiplier 220 as shifted by product left shifter 224 to supply tomultiply destination bus 203 via multiplexer Bmux 227 or the sum fromadder 226 forms the 16 most significant bits and the 16 most significantbits of multiplier first input bus 201 forms the 16 least significantbits. As noted above, in the preferred embodiment the state of the "R"bit (bit 6) of data register D0 controls this selection at multiplexerRmux 221. If this "R" bit is "0", then multiplexer Rmux 221 selects theshifted 32 bit resultant. If this "R" bit is "1", then multiplexer Rmux221 selects the 16 rounded bits and the 16 most significant bits ofmultiplier first input bus 201. Note that it is equally feasible tocontrol multiplexer Rmux 221 via an instruction word bit.

Adder 226 enables a multiply and round function on a 32 bit data wordincluding a pair of packed 16 bit half words. Suppose that a first ofthe data registers 200 stores a pair of packed half words (a :: b), asecond data register stores a first half word coefficient (X :: c1) anda third data register stores a second half word coefficient (X :: c2),where X may be any data. The desired resultant is a pair of packed halfwords (a*c2 :: b*c1) with a*c2 and b*c1 each being the rounded mostsignificant bits of the product. The desired resultant may be formed intwo instructions using adder 226 to perform the rounding. The firstinstruction is:

mdst=msrc1 * msrc2

(b*c1 :: a)=(a :: b) * (X :: c1)

As previously described multiplier first input bus 201 supplies its 16least significant bits, corresponding to b, to the first input ofmultiplier 220. At the same time multiply second input bus 202 suppliesits 16 least significant bits, corresponding to c1, to the second inputof multiplier 220. This 16 by 16 bit multiply produces a 32 bit product.The 16 most significant bits of the 32 bit resultant form one input toadder 226 with "0" supplied to the other input of adder 226. If bit 15of the 32 bit resultant is "1", then the 16 most significant bits of theresultant is incremented, otherwise these 16 most significant bits areunchanged. Thus the 16 most significant bits of the multiply operationare rounded in adder 226. Note that one input to multiplexer Rmux 221includes the 16 bit resultant from adder 226 as the 16 most significantbits and the 16 most significant bits from multiplier first input bus201, which is the value a, as the least significant bits. Also note thatthe 16 most significant bits on multiplier second input bus 202 arediscarded, therefore their initial state is unimportant. MultiplexerRmux selects the combined output from adder 226 and multiplier firstinput bus 201 for storage in a destination register in data registers200.

The packed word multiply/round operation continues with another multiplyinstruction. The resultant (b*c1 :: a) of the first multiply instructionis recalled via multiply first input bus 201. This is shown below:

mdst=msrc1 * msrc2

(a*c2 :: b*c1)=(b*c1 :: a) * (X :: c2)

The multiply occurs between the 16 least significant bits on themultiplier first input bus 201, the value a, and the 16 leastsignificant bits on the multiplier second input bus 202, the value c2.The 16 most significant bits of the resultant are rounded using adder226. These bits become the 16 most significant bits of one input tomultiplexer Rmux 221. The 16 most significant bits on multiplier firstinput bus 201, the value b*c1, becomes the 16 least significant bits ofthe input to multiplexer Rmux 221. The 16 most significant bits on themultiplier second input bus 202 are discarded. Multiplexer Rmux 221 thenselects the desired resultant (a*c2 :: b*c1) for storage in dataregisters 200 via multiplexer Bmux 227 and multiplier destination bus203. Note that this process could also be performed on data scaled viaproduct left shifter 224, with adder 226 always rounding the leastsignificant bit retained. Also note that the factors c1 and c2 may bethe same or different.

This packed word multiply/round operation is advantageous because thepacked 16 bit numbers can reside in a single register. In addition fewermemory loads and stores are needed to transfer such packed data than ifthis operation was not supported. Also note that no additional processorcycles are required in handling this packed word multiply/roundingoperation. The previous description of the packed word multiply/roundoperation partitioned multiplier first input bus 201 into two equalhalves. This is not necessary to employ the advantages of thisinvention. As a further example, it is feasible to partition multiplierfirst input bus 201 into four 8 bit sections. In this further examplemultiplier 220 forms the product of the 8 least significant bits ofmultiplier first input bus 201 and the 8 least significant bits ofmultiplier second input bus 202. After optional scaling in product leftshifter 224 and rounding via adder 226, the 8 most significant bits ofthe product form the most significant bits of one input to multiplexerMmux 221. In this further example, the least significant 24 bits of thissecond input to multiplexer Mmux 221 come from the most significant 24bits on multiplier first input bus 201. This further example permitsfour 8 bit multiplies on such a packed word in 4 passes throughmultiplier 220, with all the intermediate results and the final resultpacked into one 32 bit data word. To further generalize, this inventionpartitions the original N bit data word into a first set of M bits and asecond set of L bits. Following multiplication and rounding, a new dataword is formed including the L most significant bits of the product andthe first set of M bits from the first input. The data order in theresultant is preferably shifted or rotated in some way to permitrepeated multiplications using the same technique. As in the furtherexample described above, the number of bits M need not equal the numberof bits L. In addition, the sum of M and L need not equal the originalnumber of bits N.

In the preferred embodiment the round function selected by the "R" (bit6) of data register D0 is implemented in a manner to increase its speed.Multiplier 220 employs a common hardware multiplier implementation thatemploys internally a redundant-sign-digit notation. In theredundant-sign-digit notation each bit of the number is represented by amagnitude bit and a sign bit. This known format is useful in theinternal operation of multiplier 220 in a manner not important to thisinvention. Multiplier 220 converts the resultant from thisredundant-sign-digit notation to standard binary notation before usingthe resultant. Conventional conversion operates by subtracting thenegative signed magnitude bits from the positive signed magnitude bits.Such a subtraction ordinarily involves a delay due to borrow ripple fromthe least significant bit to the most significant bit. In the packedmultiply/round operation the desired result is the 16 most significantbits and the rounding depends upon bit 15, the next most significantbit. Though the results are the most significant bits, the borrow ripplefrom the least significant bit may affect the result. Conventionally theborrow ripple must propagate from the least significant bit to bit 15before being available to make the rounding decision.

FIG. 18 illustrates in block diagram form hardware for speeding thisrounding determination. In FIG. 18 the 32 bit multiply resultant frommultiplier 220 is separated into a most significant 16 bits (bits 31-16)coded in redundant-sign-digit form stored in register 370 and a leastsignificant 16 bits (bits 15-0) coded in redundant-sign-digit formstored in register 380. In FIG. 18 product left shifter 224 is used forscaling as previously described. Product left shifter 224 left shiftsboth the magnitude bit and the sign bit for each bit of the ofredundant-sign-digit form stored in registers 370 and 380 of multiplier220 prior to forming the resultant. The shift amount comes from multiplyshift multiplexer MSmux 225 as previously described above.

Conventionally such redundant-sign-digit notation is converted tostandard binary notation by generating carry/borrow control signals.Carry path control signal generator 382 forms three carry path controlsignals, propagate, kill and generate, from the magnitude and sign bitsof the corresponding desired resultant bit. These signals are easilyderived according to Table 11.

                  TABLE 11                                                        ______________________________________                                                                        Carry Path                                      Magnitude Sign Indicates Control Signal                                     ______________________________________                                        0        X         Zero (0)     Propagate (P)                                   1 0 Plus One (1) Kill (K)                                                     1 1 Minus One (T) Generate (G)                                              ______________________________________                                    

Carry path control signal generator 382 supplies these carry pathcontrol signals to borrow ripple unit 386. Borrow ripple unit 386 usesthe bit wise carry path control signals to control borrow ripple duringthe subtraction of the negatively signed bits from the positively signedbits. Note from Table 11 that the three signals propagate, kill andgenerate are mutually exclusive. One and only one of these signals isactive at any particular time. A propagate signal causes any borrowsignal from the previous less significant bit to propagate unchanged tothe next more significant bit. A kill signal absorbs any borrow signalfrom the prior bit and prevents propagation to the next bit. A generatesignal produces a borrow signal to propagate to the next bit whateverthe received borrow signal. Borrow ripple unit 386 propagates the borrowsignal from the least significant bit to the most significant bit. Asillustrated in FIG. 18, bits 15-0 are converted in this manner. The onlypart of the result used is the data of bit 15 d[15] and the borrowoutput signal of bit 15 b_(out) [15].

The circuit illustrated in FIG. 18 employs a different technique toderive the 16 most significant bits. Note that except for the roundingoperation that depends upon bit 15, only the 16 most significant bitsare needed in the packed multiply/round operation. There are twopossible resultants for bits 31-16 depending upon the roundingdetermination. The circuit of FIG. 18 computes both these possibleresultants in parallel and the selects the appropriate resultantdepending upon the data of bit 15 d[15] and the borrow output signal ofbit 15 b_(out) [15]. This substantially reduces the delay forming therounded value. Note that using adder 226 to form the rounded value asillustrated in FIG. 5 introduces an additional carry ripple delay withinadder 226 when forming the sum.

The circuit illustrated in FIG. 18 forms the minimum and maximumpossible rounded results simultaneously. If R is the simple conversionof the 16 most significant bits, then the rounded final result may beR-1, R or R+1. These are selected based upon the data of bit 15 d[15]and the borrow output signal of bit 15 b_(out) [15] according to Table12.

                  TABLE 12                                                        ______________________________________                                        d[15]  b.sub.out [15]                                                                          Final Result                                                 ______________________________________                                        0      0         R       Neither increment nor decrement                        0 1 R - 1 Decrement only                                                      1 0 R + 1 Increment only                                                      1 1 R Both increment and decrement                                          ______________________________________                                    

The circuit of FIG. 18 computes the value R-1 for the 16 mostsignificant bits employing carry path control signal generator 372 andborrow ripple unit 376. Carry path control signal generator 372 is thesame as carry path control signal generator 382 and operates accordingto Table 11. Borrow ripple unit 376 is the same as borrow ripple unit386. Borrow ripple unit 376 computes the value R-1 because the borrow-ininput is always supplied with a borrow value of "1", thus alwaysperforming a decrement of the simple conversion value R.

The circuit of FIG. 18 forms the value R+1 by adding 2 to the value ofR-1. Note that a binary number may be incremented by 1 by toggling allthe bits up to and including the right most "0" bit in the originalbinary number. The circuit of FIG. 18 employs this technique todetermine bits 31-17. This addition takes place in two stages in amanner not requiring a carry borrow for the entire 16 bits. In the firststage, mask ripple unit 374 generates a mask from the carry path controlsignals. An intermediate mask is formed with a "1" in any bit positionin which the converted result is known to be "0" or known to differ fromthe result of the prior bit. Mask ripple unit 374 sets other bitpositions to "0". The manner of forming this intermediate mask is shownin Table 13.

                  TABLE 13                                                        ______________________________________                                                          Final Result   Intermediate                                   Bit[n] Bit[n - 1] of Bit[n] Mask Value                                      ______________________________________                                        T (G)   T (G)     0              1                                              0 (P) T (G) 1 0                                                               1 (K) T (G) 0 1                                                               T (G) 0 (P) Different from Bit[n - 1] 1                                       0 (P) 0 (P) Same as Bit[n - 1] 0                                              1 (K) 0 (P) Different from Bit[n - 1] 1                                       T (G) 1 (K) 1 0                                                               0 (P) 1 (K) 0 1                                                               1 (K) 1 (K) 1 0                                                             ______________________________________                                    

Review of the results of Table 13 reveal that this operation can beperformed by the function P[n] XNOR K[n-1]. Thus a simple circuitgenerates the intermediate mask for each bit. Mask ripple unit 374ripples through the intermediate mask until reaching the right most "0".Those bits including the right most "0" bit are set to "1", and all moresignificant bits are set to "0". This toggle mask and the R-1 resultfrom borrow ripple unit 376 are supplied to exclusive OR unit 378.Exclusive OR unit 378 toggles those bits from borrow ripple unit 376corresponding to the mask generated by mask ripple unit 374.

Multiplexer 390 assembles the rounded resultant. This operation takesplace as shown in Tables 14 and 15. Table 14 shows the derivation of bit16, the least significant rounded bit of the desired resultant,depending upon the data of bit 15 d[15] and the borrow output signal ofbit 15 b_(out) [15]. These results from the 16 least significant bits ofthe output of multiplier 220 are available from borrow ripple unit 386.

                  TABLE 14                                                        ______________________________________                                                                  Final Result                                          d[15] b.sub.out [15] for Bit[16]                                            ______________________________________                                        0         0               ˜R - 1[16]                                      0 1  R - 1[16]                                                                1 0  R - 1[16]                                                                1 1 ˜R - 1[16]                                                        ______________________________________                                    

The data of bit 15 d[15], the borrow output signal of bit 15 b_(out)[15] and the final result of bit 16 determine bits 31-17 according toTable 15.

                  TABLE 15                                                        ______________________________________                                                            Final Result                                                                            Final Result                                      d[15] b.sub.out [15] of Bit[16] Bits 31-17                                  ______________________________________                                        0       0           0         R + 1[31-17]                                      0 0 1 R - 1[31-17]                                                            0 1 X R - 1[31-17]                                                            1 0 X R + 1[31-17]                                                            1 1 0 R + 1[31-17]                                                            1 1 1 R - 1[31-17]                                                          ______________________________________                                    

Thus multiplexer 390 forms the desired rounded resultant, which is thesame as formed by adder 226. The manner of generation of the roundedresultant substantially eliminates the carry ripple delay associatedwith adder 226. Note that FIG. 5 contemplates circuits similar to carrypath control signal generators 372 and 382 and borrow ripple units 376and 386 to generate the output of multiplier 220 in normal coded form.Thus the circuit illustrated in FIG. 18 substitutes the delay ofexclusive OR unit 378 and multiplexer 390 for the carry ripple delay ofadder 226. The delay of exclusive OR unit 378 and multiplexer 390 isexpected to be considerably less than the delay of adder 226. This is ina critical path, because the rounding performed by adder 226 follows theoperation of multiplier 220. Thus this reduction in delay enablesspeeding up of the entire execute pipeline stage. This in turn enhancesthe rate of operation of multi-processor integrated circuit 100.

Note that the circuit illustrated in FIG. 18 is employed as describedabove only if the "R" bit of data register 200 D0 selects the packedword multiply/rounding operation. In the event that the "R" bit of dataregister 200 D0 is "0", the packed word multiply/round operation is notenabled. In this event borrow ripple units 376 and 386 may be connectedconventionally, with the signal b_(out) [15] from borrow ripple unit 386coupled to the borrow input b_(in) of borrow ripple unit 376. Borrowripple units 376 and 386 thus produce the shifted 32 bit resultant ofmultiplier 220 for selection by multiplexer Rmux 221.

Arithmetic logic unit 230 performs arithmetic and logic operationswithin data unit 110. Arithmetic logic unit 230 advantageously includesthree input ports for performing three input arithmetic and logicoperations. Numerous buses and auxiliary hardware supply the threeinputs.

Input A bus 241 supplies data to an A-port of arithmetic logic unit 230.Multiplexer Amux 232 supplies data to input A bus 241 from eithermultiplier second input bus 202 or arithmetic logic unit first input bus205 depending on the instruction. Data on multiplier second input bus202 may be from a specified one of data registers 200 or from animmediate field of the instruction via multiplexer Imux 222 and buffer223. Data on arithmetic logic unit first input bus 205 may be from aspecified one of data registers 200 or from global port source data busGsrc bus 105 via buffer 106. Thus the data supplied to the A-port ofarithmetic logic unit 230 may be from one of the data registers 200,from an immediate field of the instruction word or a long distancesource from another register of digital image/graphics processor 71 viaglobal source data bus Gsrc 105 and buffer 106.

Input B bus 242 supplies data to the B-port of arithmetic logic unit230. Barrel rotator 235 supplies data to input B bus 242. Thus barrelrotator 235 controls the input to the B-port of arithmetic logic unit230. Barrel rotator 235 receives data from arithmetic logic unit secondinput bus 206. Arithmetic logic unit second input bus 206 supplies datafrom a specified one of data registers 200, data from global port sourcedata bus Gsrc bus 105 via buffer 104 or a special data word from buffer236. Buffer 236 supplies a 32 bit data constant of"00000000000000000000000000000001" (also called Hex "1") to arithmeticlogic unit second input bus 206 if enabled. Note hereinafter data oraddresses preceded by "Hex" are expressed in hexadecimal. Data fromglobal port source data bus Gsrc 105 may be supplied to barrel rotator235 as a long distance source as previously described. When buffer 236is enabled, barrel rotator 235 enables generation on input B bus 242 ofany constant of the form 2^(N), where N is the barrel rotate amount.Constants of this form are useful in operations to control only a singlebit of a 32 bit data word. The data supplied to arithmetic logic unitsecond input bus 206 and barrel rotator 235 depends upon theinstruction.

Barrel rotator 235 is a 32 bit rotator that may rotate its received datafrom 0 to 31 positions. It is a left rotator, however, a right rotate ofn bits may be obtained by left rotating 32-n bits. A five bit input fromrotate bus 244 controls the amount of rotation provided by barrelrotator 235. Note that the rotation is circular and no bits are lost.Bits rotated out the left of barrel rotator 235 wrap back into theright. Multiplexer Smux 231 supplies rotate bus 244. Multiplexer Smux231 has several inputs. These inputs include: the five least significantbits of multiplier first input bus 201; the five least significant bitsof multiplier second input bus 202; five bits from the "DBR" field ofdata register D0; and a five bit zero constant "00000". Note thatbecause multiplier second input bus 202 may receive immediate data viamultiplexer Imux 222 and buffer 223, the instruction word can supply animmediate rotate amount to barrel rotator 235. Multiplexer Smux 231selects one of these inputs to determine the amount of rotation inbarrel rotator 235 depending on the instruction. Each of these rotatequantities is five bits and thus can set a left rotate in the range from0 to 31 bits.

Barrel rotator 235 also supplies data to multiplexer Bmux 227. Thispermits the rotated data from barrel rotator 235 to be stored in one ofthe data registers 200 via multiplier destination bus 203 in parallelwith an operation of arithmetic logic unit 230. Barrel rotator 235shares multiplier destination bus 203 with multiplexer Rmux 221 viamultiplexer Bmux 227. Thus the rotated data cannot be saved if amultiply operation takes place. In the preferred embodiment this writeback method is particularly supported by extended arithmetic logic unitoperations, and can be disabled by specifying the same registerdestination for barrel rotator 235 result as for arithmetic logic unit230 result. In this case only the result of arithmetic logic unit 230appearing on arithmetic logic unit destination bus 204 is saved.

Although the above description refers to barrel rotator 235, thoseskilled in the art would realize that substantial utility can beachieved using a shifter which does not wrap around data. Particularlyfor shift and mask operations where not all of the bits to the B-port ofarithmetic logic unit 230 are used, a shifter controlled by rotate bus244 provides the needed functionality. In this event an additional bit,such as the most significant bit on the rotate bus 244, preferablyindicates whether to form a right shift or a left shift. Five bits onrotate bus 244 are still required to designate the magnitude of theshift. Therefore it should be understood in the description below that ashifter may be substituted for barrel rotator 235 in many instances.

Input C bus 243 supplies data to the C-port of arithmetic logic unit230. Multiplexer Cmux 233 supplies data to input C bus 243. MultiplexerCmux 233 receives data from four sources. These are LMO/RMO/LMBC/RMBCcircuit 237, expand circuit 238, multiplier second input bus 202 andmask generator 239.

LMO/RMO/LMBC/RMBC circuit 237 is a dedicated hardware circuit thatdetermines either the left most "1", the right most "1", the left mostbit change or the right most bit change of the data on arithmetic logicunit second input bus 206 depending on the instruction or the "FMOD"field of data register D0. LMO/RMO/LMBC/RMBC circuit 237 supplies tomultiplexer Cmux 233 a 32 bit number having a value corresponding to thedetected quantity. The left most bit change is defined as the positionof the left most bit that is different from the sign bit 32. The rightmost bit change is defined as the position of the right most bit that isdifferent from bit 0. The resultant is a binary number corresponding tothe detected bit position as listed below in Table 16. The values areeffectively the big endian bit number of the detected bit position,where the result is 31-(bit position).

                  TABLE 16                                                        ______________________________________                                                bit                                                                     position result                                                             ______________________________________                                                 0    31                                                                 1 30                                                                          2 29                                                                          3 28                                                                          4 27                                                                          5 26                                                                          6 25                                                                          7 24                                                                          8 23                                                                          9 22                                                                         10 21                                                                         11 20                                                                         12 19                                                                         13 18                                                                         14 17                                                                         15 16                                                                         16 15                                                                         17 14                                                                         18 13                                                                         19 12                                                                         20 11                                                                         21 10                                                                         22  9                                                                         23  8                                                                         24  7                                                                         25  6                                                                         26  5                                                                         27  4                                                                         28  3                                                                         29  2                                                                         30  1                                                                         31  0                                                                       ______________________________________                                    

This determination is useful for normalization and for image compressionto find a left most or right most "1" or changed bit as an edge of animage. The LMO/RMO/LMBC/RMBC circuit 237 is a potential speed path,therefore the source coupled to arithmetic logic unit second input bus206 is preferably limited to one of the data registers 200. For the leftmost "1" and the right most "1" operations, the "V" bit indicatingoverflow of status register 210 is set to "1" if there were no "1's" inthe source, and "0" if there were. For the left most bit change and theright most bit change operations, the "V" bit is set to "1" if all bitsin the source were equal, and "0" if a change was detected. If the "V"bit is set to "1" by any of these operations, the LMO/RMO/LMBC/RMBCresult is effectively 32. Further details regarding the operation ofstatus register 210 appear above.

Expand circuit 238 receives inputs from multiple flags register 211 andstatus register 210. Based upon the "Msize" field of status register 210described above, expand circuit 238 duplicates some of the leastsignificant bits stored in multiple flags register 211 to fill 32 bits.Expand circuit 238 may expand the least significant bit 32 times, expandthe two least significant bits 16 times or expand the four leastsignificant bits 8 times. The "Asize" field of status register 210controls processes in which the 32 bit arithmetic logic unit 230 issplit into independent sections for independent data operations. This isuseful for operation on pixels sizes less than the 32 bit width ofarithmetic logic unit 230. This process, as well as examples of its use,will be further described below.

Mask generator 239 generates 32 bit masks that may be supplied to theinput C bus 243 via multiplexer Cmux 233. The mask generated depends ona 5 bit input from multiplexer Mmux 234. Multiplexer Mmux 234 selectseither the 5 least significant bits of multiplier second input bus 202,or the "DBR" field from data register D0. In the preferred embodiment,an input of value N causes mask generator 239 to generate a maskgenerated that has N "1's" in the least significant bits, and 32-N "0's"in the most significant bits. This forms an output having N rightjustified "1's". This is only one of four possible methods of operationof mask generator 239. In a second embodiment, mask generator 239generates the mask having N right justified "0's", that is N "0's" inthe least significant bits and N-32 "1's" in the most significant bits.It is equally feasible for mask generator 239 to generate the maskhaving N left justified "1's" or N left justified "0's". Table 17illustrates the operation of mask generator 239 in accordance with thepreferred embodiment when multiple arithmetic is not selected.

                  TABLE 17                                                        ______________________________________                                        Mask                                                                            Generator                                                                     Input Mask - Nonmultiple Operation                                          ______________________________________                                        0 0 0 0 0                                                                              0000 0000 0000 0000 0000 0000 0000 0000                                0 0 0 0 1 0000 0000 0000 0000 0000 0000 0000 0001                             0 0 0 1 0 0000 0000 0000 0000 0000 0000 0000 0011                             0 0 0 1 1 0000 0000 0000 0000 0000 0000 0000 0111                             0 0 1 0 0 0000 0000 0000 0000 0000 0000 0000 1111                             0 0 1 0 1 0000 0000 0000 0000 0000 0000 0001 1111                             0 0 1 1 0 0000 0000 0000 0000 0000 0000 0011 1111                             0 0 1 1 1 0000 0000 0000 0000 0000 0000 0111 1111                             0 1 0 0 0 0000 0000 0000 0000 0000 0000 1111 1111                             0 1 0 0 1 0000 0000 0000 0000 0000 0001 1111 1111                             0 1 0 1 0 0000 0000 0000 0000 0000 0011 1111 1111                             0 1 0 1 1 0000 0000 0000 0000 0000 0111 1111 1111                             0 1 1 0 0 0000 0000 0000 0000 0000 1111 1111 1111                             0 1 1 0 1 0000 0000 0000 0000 0001 1111 1111 1111                             0 1 1 1 0 0000 0000 0000 0000 0011 1111 1111 1111                             0 1 1 1 1 0000 0000 0000 0000 0111 1111 1111 1111                             1 0 0 0 0 0000 0000 0000 0000 1111 1111 1111 1111                             1 0 0 0 1 0000 0000 0000 0001 1111 1111 1111 1111                             1 0 0 1 0 0000 0000 0000 0011 1111 1111 1111 1111                             1 0 0 1 1 0000 0000 0000 0111 1111 1111 1111 1111                             1 0 1 0 0 0000 0000 0000 1111 1111 1111 1111 1111                             1 0 1 0 1 0000 0000 0001 1111 1111 1111 1111 1111                             1 0 1 1 0 0000 0000 0011 1111 1111 1111 1111 1111                             1 0 1 1 1 0000 0000 0111 1111 1111 1111 1111 1111                             1 1 0 0 0 0000 0000 1111 1111 1111 1111 1111 1111                             1 1 0 0 1 0000 0001 1111 1111 1111 1111 1111 1111                             1 1 0 1 0 0000 0011 1111 1111 1111 1111 1111 1111                             1 1 0 1 1 0000 0111 1111 1111 1111 1111 1111 1111                             1 1 1 0 0 0000 1111 1111 1111 1111 1111 1111 1111                             1 1 1 0 1 0001 1111 1111 1111 1111 1111 1111 1111                             1 1 1 1 0 0011 1111 1111 1111 1111 1111 1111 1111                             1 1 1 1 1 0111 1111 1111 1111 1111 1111 1111 1111                           ______________________________________                                    

A value N of "0" thus generates 32 "0's". In some situations however itis preferable that a value of "0" generates 32 "1's". This function isselected by the "%!" modification specified in the "FMOD" field ofstatus register 210 or in bits 52, 54, 56 and 58 of the instruction whenexecuting an extended arithmetic logic unit operation. This function canbe implemented by changing the mask generated by mask generator 239 orby modifying the function of arithmetic logic unit 230 so that mask ofall "0's" supplied to the C-port operates as if all "1's" were supplied.Note that similar modifications of the other feasible mask functions arepossible. Thus the "%!" modification can change a mask generator 239which generates a mask having N right justified "0's" to all "0's" forN=0. Similarly, the "%!" modification can change a mask generator 239which generates N left justified "1's" to all "1's" for N=0, or change amask generator 239 which generates N left justified "0's" to all "0's"for N=0.

Selection of multiple arithmetic modifies the operation of maskgenerator 239. When the "Asize" field of status register is "110", thisselects a data size of 32 bits and the operation of mask generator 239is unchanged from that shown in Table 17. When the "Asize" field ofstatus register is "101", this selects a data size of 16 bits and maskgenerator 239 forms two independent 16 bit masks. This is shown in Table18. Note that in this case the most significant bit of the input to maskgenerator 239 is ignored. Table 18 shows this bit as a don't care "X".

                  TABLE 18                                                        ______________________________________                                        Mask                                                                            Generator                                                                     Input Mask - Half Word Operation                                            ______________________________________                                        X 0 0 0 0                                                                              0000 0000 0000 0000 0000 0000 0000 0000                                X 0 0 0 1 0000 0000 0000 0001 0000 0000 0000 0001                             X 0 0 1 0 0000 0000 0000 0011 0000 0000 0000 0011                             X 0 0 1 1 0000 0000 0000 0111 0000 0000 0000 0111                             X 0 1 0 0 0000 0000 0000 1111 0000 0000 0000 1111                             X 0 1 0 1 0000 0000 0001 1111 0000 0000 0001 1111                             X 0 1 1 0 0000 0000 0011 1111 0000 0000 0011 1111                             X 0 1 1 1 0000 0000 0111 1111 0000 0000 0111 1111                             X 1 0 0 0 0000 0000 1111 1111 0000 0000 1111 1111                             X 1 0 0 1 0000 0001 1111 1111 0000 0001 1111 1111                             X 1 0 1 0 0000 0011 1111 1111 0000 0011 1111 1111                             X 1 0 1 1 0000 0111 1111 1111 0000 0111 1111 1111                             X 1 1 0 0 0000 1111 1111 1111 0000 1111 1111 1111                             X 1 1 0 1 0001 1111 1111 1111 0001 1111 1111 1111                             X 1 1 1 0 0011 1111 1111 1111 0011 1111 1111 1111                             X 1 1 1 1 0111 1111 1111 1111 0111 1111 1111 1111                           ______________________________________                                    

The function of mask generator 239 is similarly modified for a selectionof byte data via an "Asize" field of "100". Mask generator 239 formsfour independent masks using only the three least significant bits ofits input. This is shown in Table 19.

                  TABLE 19                                                        ______________________________________                                        Mask                                                                            Generator                                                                     Input Mask - Byte Operation                                                 ______________________________________                                        X X 0 0 0                                                                              0000 0000 0000 0000 0000 0000 0000 0000                                X X 0 0 1 0000 0001 0000 0001 0000 0001 0000 0001                             X X 0 1 0 0000 0011 0000 0011 0000 0011 0000 0011                             X X 0 1 1 0000 0111 0000 0111 0000 0111 0000 0111                             X X 1 0 0 0000 1111 0000 1111 0000 1111 0000 1111                             X X 1 0 1 0001 1111 0001 1111 0001 1111 0001 1111                             X X 1 1 0 0011 1111 0011 1111 0011 1111 0011 1111                             X X 1 1 1 0111 1111 0111 1111 0111 1111 0111 1111                           ______________________________________                                    

As noted above, it is feasible to support multiple operations of 8sections of 4 bits each, 16 sections of 2 bits each and 32 single bitsections. Those skilled in the art would realize that these other datasizes require similar modification to the operation of mask generator239 as shown above in Tables 17, 18, and 19.

Data unit 110 includes a three input arithmetic logic unit 230.Arithmetic logic unit 230 includes three input buses: input A bus 241supplies an input to an A-port; input B bus 242 supplies an input to aB-port; and input C bus 243 supplies an input to a C-port. Arithmeticlogic unit 230 supplies a resultant to arithmetic logic unit destinationbus 204. This resultant may be stored in one of the data registers ofdata registers 200. Alternatively the resultant may be stored in anotherregister within digital image/graphics processor 71 via buffer 108 andglobal port destination data bus Gdst 107. This function is called along distance operation. The instruction specifies the destination ofthe resultant. Function signals supplied to arithmetic logic unit 230from function signal generator 245 determine the particular three inputfunction executed by arithmetic logic unit 230 for a particular cycle.Bit 0 carry-in generator 246 forms a carry-in signal supplied to bit 0,the first bit of arithmetic logic unit 230. As previously described,during multiple arithmetic operations bit 0 carry-in generator 246supplies the carry-in signal to the least significant bit of each of themultiple sections.

FIG. 19 illustrates in block diagram form the construction of anexemplary bit circuit 400 of arithmetic logic unit 230. Arithmetic logicunit 230 preferably operates on data words of 32 bits and thus consistsof 32 bit circuits 400 in parallel. Each bit circuit 400 of arithmeticlogic unit 230 receives: the corresponding bits of the three inputsA_(i), B_(i) and C_(i) ; a zero carry-in signal designated c_(in0) fromthe previous bit circuit 400; a one carry-in signal designated c_(in1)from the previous bit circuit 400; an arithmetic enable signal A_(en) ;an inverse kill signal K_(i-1) from the previous bit circuit; a carrysense select signal for selection of carry-in signal C_(in0) or C_(in1); and eight inverse function signals F7-F0. The carry-in signals c_(in0)and c_(in1) for the first bit (bit 0) are identical and are generated bya special circuit that will be described below. Note that the inputsignals A_(i), B_(i) and C_(i) are formed for each bit of arithmeticlogic unit 230 and may differ. The arithmetic enable signal A_(en) andthe inverted function signals F7-F0 are the same for all of the 32 bitcircuits 400. Each bit circuit 400 of arithmetic logic unit 230generates: a corresponding one bit resultant S_(i) ; an early zerosignal Z_(i) ; a zero carry-out signal designated c_(out0) that formsthe zero carry-in signal c_(in0) for the next bit circuit; a onecarry-out signal designated c_(out1) that forms the one carry-in signalc_(in1) for the next bit circuit; and an inverse kill signal K_(i) thatforms the inverse kill signal K_(i-1) for the next bit circuit. Aselected one of the zero carry-out signal c_(out0) or the one carry-outsignal c_(out) 1 of the last bit in the 32 bit arithmetic logic unit 230is stored in status register 210, unless the "C" bit is protected fromchange for that instruction. In addition during multiple arithmetic theinstruction may specify that carry-out signals from separate arithmeticlogic unit sections be stored in multiple flags register 211. In thisevent the selected zero carry-out signal c_(out0) or the one carry-outsignal c_(out1) will be stored in multiple flags register 211.

Bit circuit 400 includes resultant generator 401, carry out logic 402and Boolean function generator 403. Boolean function generator 403 formsa Boolean combination of the respective bits inputs A_(i), B_(i) andC_(i) according to the inverse function signals F7-F0. Boolean functiongenerator produces a corresponding propagate signal P_(i), a generatesignal G_(i) and a kill signal K_(i). Resultant logic 401 combines thepropagate signal P_(i) with one of the carry-in signal c_(in0) orcarry-in signal c_(in1) from a prior bit circuit 400 as selected by thecarry sense select signal and forms the bit resultant S_(i) and an earlyzero signal Z_(i). Carry out logic 402 receives the propagate signalP_(i), the generate signal G_(i), the kill signal K_(i), the twocarry-in signals c_(in0) and c_(in1) and an arithmetic enable signalA_(en). Carry out logic 402 produces two carry-out signals c_(out0) andc_(out1) that are supplied to the next bit circuit 400.

FIGS. 20 and 21 together illustrate an exemplary bit circuit 400 ofarithmetic logic unit 230. FIG. 20 illustrates the details of aresultant logic 401 and carry out logic 402 of each bit circuit 400 ofarithmetic logic unit 230. FIG. 21 illustrates the details of thecorresponding Boolean function generator 403 of each bit circuit 400 ofarithmetic logic unit 230.

Each resultant logic 401 generates a corresponding resultant signalS_(i) and an early zero signal Z_(i). Resultant logic 420 forms thesesignals from the two carry-in signals, an inverse propagate signalP_(i), an inverse kill signal K_(i-1) from the previous bit circuit anda carry sense select signal. The carry out logic 402 forms two carry-outsignals and an inverse kill signal K_(i). These signals are formed fromthe two carry-in signals, an inverse propagate signal P_(i), an inversegenerate signal G_(i) and a kill signal K_(i) for that bit circuit 400.Each propagate signal indicates whether a "1" carry-in signal propagatesthrough the bit circuit 400 to the next bit circuit 400 or is absorbed.The generate signal indicates whether the inputs to the bit circuit 400generate a "1" carry-out signal to the next bit circuit 400. The killsignal indicates whether the input to the bit circuit 400 generate a "0"carry-out signal to the next bit circuit. Note that the propagate signalP_(i), the generate signal G_(i) and the kill signal K_(i) are mutuallyexclusive. Only one of these signals is generated for each combinationof inputs.

Each bit circuit 400 of arithmetic logic unit 230 employs a technique toreduce the carry ripple time through the 32 bits. Arithmetic logic unit230 is divided into carry sections, preferably 4 sections of 8 bitseach. The least significant bit circuit 400 of each such section has itszero carry-in signal c_(in0) hardwired to "0" and its one carry-insignal c_(in1) hardwired to "1". Each bit circuit 400 forms tworesultants and two carry-out signals to the next bit circuit. Once thecarry ripple through each section is complete, the actual carry outputfrom the most significant bit of the previous carry section forms thecarry sense select signal. This carry select signal permits selection ofthe actual resultant generated by the bits of a section via amultiplexer. The first carry section receives its carry select signalfrom bit 0 carry-in generator 246 described in detail below. Thistechnique permits the carry ripple through the carry sections to takeplace simultaneously. This reduces the length of time required togenerate the resultant at the cost of some additional hardware for theredundant carry lines and the carry sense selection.

Carry out logic 402 controls transformation of the carry-in signals intothe carry-out signals. Carry out logic 402 includes identical circuitoperating on the two carry-in signals c_(in0) and c_(in1). The inversepropagate signal P_(i) and its inverse, the propagate signal P_(i)formed by invertor 412, control pass gates 413 and 423. If the propagatesignal P_(i) is "1", then one carry-in line 410 is connected to onecarry-out line 411 via pass gate 413 and zero carry-in line 420 isconnected to zero carry-out line 421 via pass gate 423. Thus thecarry-in signal is propagated to the carry-out. If the propagate signalP_(i) is "0", then one carry-in line 410 is isolated from one carry-outline 411 and zero carry-in line 420 is isolated from carry-out line 421.If the generate signal G_(i) is "1", that is if the inverse generatesignal G_(i) is "0", then P-channel MOSFET (metal oxide semiconductorfield effect transistor) 414 is turned on to couple the supply voltageto carry-out line 411 and P-channel MOSFET 424 is turned on to couplethe supply voltage to carry-out line 421. If the generate signal G_(i)is "0", that is if the inverse generate signal G_(i) is "1", then theP-channel MOSFETs 414 and 424 are cut off and do not affect thecarry-out lines 411 and 421. If the kill signal K_(i) is "1", thenN-channel MOSFET 415 couples ground to carry-out line 411 and N-channelMOSFET 425 couples ground to carry-out line 421. If the kill signalK_(i) is "0+, then the N-channel MOSFETs 415 and 425 are cut off and donot affect the carry-out lines 411 and 421. Invertor 422 generates theinverse kill signal K_(i) supplied to the next bit circuit.

Exclusive OR circuits 431 and 433 form the two resultants of resultantlogic 401. Exclusive OR circuits 431 and 433 each receive the propagatesignal P_(i) from invertor 427 on an inverting input and the inversepropagate signal P_(i) from invertor 428 on a noninverting input.Exclusive OR circuit 431 receives the inverse zero carry-in signalc_(in0) from invertor 426 on a noninverting input and forms theresultant for the case of a "0" carry-in to the least significant bit ofthe current carry section. Likewise, exclusive OR circuit 433 receivesthe inverse one carry-in signal c_(in1) from invertor 416 on anoninverting input and forms the resultant for the case of a "1"carry-in to the least significant bit of the current carry section.Invertors 432 and 434 supply inputs to multiplexer 435. Multiplexer 435selects one of these signals based upon the carry sense select signal.This carry sense select signal corresponds to the actual carry-outsignal from the most significant bit of the previous carry section. Theinverted output of multiplexer 435 from invertor 436 is the desired bitresultant S_(i).

Resultant logic 401 also forms an early zero signal Z_(i) for that bitcircuit. This early zero signal Z_(i) gives an early indication that theresultant S_(i) of that bit circuit 400 is going to be "0". Exclusive ORcircuit 437 receives the propagate signal P_(i) from invertor 427 on aninverting input and the inverse propagate signal P_(i) from invertor 428on a noninverting input. Exclusive OR circuit 437 also receives theinverse kill signal K_(i-1) from the previous bit circuit 400 on anoninverting input. Exclusive OR circuit 437 forms early zero signalZ_(i) for the case in which the previous bit kill signal K_(i-1)generates a "0" carry-out signal and the propagate signal P_(i) is also"0". Note that if K_(i-1) is "0", then both the zero carry-out signalc_(out0) and the one carry-out signal c_(out1) are "0" whatever thestate of the carry-in signals c_(in0) and c_(in1). Note that this earlyzero signal Z_(i) is available before the carry can ripple through thecarry section. This early zero signal Z_(i) may thus speed thedetermination of a zero output from arithmetic logic unit 230.

Boolean function generator 403 of each bit circuit 400 of arithmeticlogic unit 230 illustrated in FIG. 21 generates the propagate signalP_(i), the generate signal G_(i) and the kill signal K_(i) for bitcircuit 400. Boolean function generator 403 consists of four levels. Thefirst level includes pass gates 451, 452, 453, 454, 455, 456, 457 and458. Pass gates 451, 453, 455 and 457 are controlled in a first sense byinput C_(i) and inverse input C_(i) from invertor 459. Pass gates 452,454, 456 and 458 are controlled in an opposite sense by input C_(i) andinverse input C_(i). Depending on the state of input C_(i), either passgates 451, 453, 455 and 457 are conductive or pass gates 452, 454, 456and 458 are conductive. The second level includes pass gates 461, 462,463 and 464. Pass gates 461 and 463 are controlled in a first sense byinput B_(i) and inverse input B_(i) from invertor 465. Pass gates 462and 464 are controlled in the opposite sense. Depending on the state ofinput B_(i), either pass gates 461 and 463 are conductive or pass gates462 and 464 are conductive. The third level includes pass gates 471, 472and 473. Pass gates 471 is controlled in a first sense by input A_(i)and inverse input A_(i) from invertor 473. Pass gates 472 and 473 arecontrolled in the opposite sense. Depending on the state of input A_(i),either pass gates 471 is conductive or pass gates 472 and 473 areconductive. The first level includes invertors 441, 442, 443, 444, 445,446, 447 and 448 that are coupled to corresponding inverted functionsignals F7-F0. Invertors 441, 442, 443, 444, 445, 446, 447 and 448provide input drive to Boolean function generator 403 and determine thelogic function performed by arithmetic logic unit 230.

Boolean function generator 403 forms the propagate signal P_(i) basedupon the corresponding input signals A_(i), B_(i) and C_(i) and thefunction selected by the state of the inverted function signals F7-F0.The propagate signal P_(i) at the input to invertor 476 is "1" if anypath through pass gates 451, 452, 453, 454, 455, 456, 457, 458, 461,462, 463, 464, 471 or 472 couples a "1" from one of the invertors 441,442, 443, 444, 445, 446, 447 or 448. In all other cases this propagatesignal P_(i) is "0". Invertor 476 forms the inverse propagate signalP_(i), which is connected to resultant logic 401 illustrated in FIG. 20.

Each pass gate 451, 452, 453, 454, 455, 456, 457, 458, 461, 462, 463,464, 471, 472 and 473 consists of an N-channel MOSFET and a P-channelMOSFET disposed in parallel. The gate of the N-channel MOSFET receives acontrol signal. This field effect transistor is conductive if its gateinput is above the switching threshold voltage. The gate of theP-channel MOSFET is driven by the inverse of the control signal via oneof the invertors 459, 465 or 474. This field effect transistor isconductive if its gate input is below a switching threshold. Because theP-channel MOSFET operates in inverse to the operation of N-channelMOSFET, the corresponding invertor 459, 467 or 474 assures that thesetwo field effect transistors are either both conducting or bothnon-conducting. The parallel N-channel and P-channel field effecttransistors insure conduction when desired whatever the polarity of thecontrolled input.

Tri-state AND circuit 480 forms the generate signal G_(i) and the killsignal K_(i). The generate signal G_(i), the kill signal K₁ and thepropagate signal P_(i) are mutually exclusive in the preferredembodiment. Therefore the propagate signal P_(i) controls the output oftri-state AND circuit 480. If the propagate signal P_(i) is "1", thentri-state AND circuit 480 is disabled and both the generate signal G_(i)and the kill signal K_(i) are "0". Thus neither the generate signalG_(i) nor the kill signal K_(i) change the carry signal. Pass gate 473couples the output from part of Boolean function generator 403 to oneinput of tri-state AND circuit 480. The gate inputs of pass gate 473 arecoupled to the first input bit A_(i) in the first sense. An N-channelMOSFET 475 conditionally couples this input of tri-state AND circuit 480to ground. The inverse of the first input bit A_(i) supplies the gateinput to N-channel MOSFET 475. Pass gate 473 and N-channel MOSFET 475are coupled in a wired OR relationship, however no OR operation takesplace because their gate inputs cause them to be conductive alternately.N-channel MOSFET 475 serves to force a "0" input into tri-state ANDcircuit 480 when A_(i) ="0". An arithmetic enable signal supplies thesecond input to tri-state AND circuit 480.

The tri-state AND gate 480 operates as follows. If the propagate signalP_(i) is "1", then both P-channel MOSFET 481 and N-channel MOSFET 482are conductive and pass gate 483 is non-conductive. This cuts offP-channel MOSFETs 414 and 424 and N-channel MOSFETs 415 and 425 so thatnone of these field effect transistor conducts. The output of tri-stateAND circuit 480 thus is a high impedance state that does not change thesignal on the carry-out lines 411 and 421. If the propagate signal P_(i)is "0", then both P-channel MOSFET 481 and N-channel MOSFET 482 arenon-conductive and pass gate 483 is conductive. The circuit then forms alogical AND of the two inputs. If either arithmetic enable or the signalat the junction of N-channel MOSFET 475 and pass gate 473 is "0" or bothare "0", then at least one of P-channel MOSFET 484 or P-channel MOSFET485 connects the supply voltage V+ (a logic "1") as the inverse generatesignal G_(i) to the gates of P-channel MOSFETs 414 and 424 of carry outlogic 402. Thus P-channel MOSFETs 414 and 424 are non-conductive. At thesame time pass gate 483 is conductive and supplies this "1" signal askill signal K_(i) to the gates of N-channel MOSFETs 415 and 425 of carryout logic 402. This actively pulls down the signal on zero carry-outline 421 forcing the zero carry-out signal c_(out0) to "0" and onecarry-out line 411 forcing the one carry-out signal c_(out1) to "0". Ifboth the inputs are "1", then the series combination of N-channel MOSFET486 and N-channel MOSFET 487 supplies ground (a logic "0") to the gatesof N-channel MOSFETs 415 and 425. N-channel MOSFETs 415 and 425 of carryout logic 402 are cut off and non-conductive. At the same time pass gate483 couples this "0" to the gates of P-channel MOSFETs 414 and 424. ThusP-channel MOSFETs 414 and 424 of carry out logic 402 are conductive.This actively pulls up the signal on zero carry-out line 421 forcing thezero carry-out signal c_(out0) to "1" and one carry-out line 411 forcingthe one carry-out signal c_(out1) to "1".

The bit circuit construction illustrated in FIG. 20 and 21 forms apropagate term, a generate term, a resultant term and two carry-outterms. Bit circuit 400 forms the propagate term P_(i) as follows:##EQU1## Bit circuit 400 forms the generate term G_(i) as follows:

    G.sub.i =A.sub.i &[(F0&˜F1&˜B.sub.i &˜C.sub.i) | (F2&˜F3& B.sub.i &˜C.sub.i) | (F4&˜F5&˜B.sub.i & C.sub.i) | (F6&˜F7& B.sub.i & C.sub.i)]

Bit circuit 400 forms the kill terms K_(i) as follows:

    K.sub.i =˜G.sub.i & ˜P.sub.i

Bit circuit 400 forms the resultant term S_(i) as follows:

    S.sub.i =P.sub.i   (c.sub.ino & CSS | c.sub.in1 &˜CSS)

where: CSS is the carry sense select signal. Bit circuit 400 forms thetwo carry-out signals c_(pit0) and c_(out1) as follows:

    c.sub.out0 =(P.sub.i & c.sub.in0) | (G.sub.i & A.sub.en) | ˜(K.sub.i & A.sub.en)

    c.sub.out1 =(P.sub.i & c.sub.in1) | (G.sub.i & A.sub.en) | ˜(K.sub.i & A.sub.en)

Note that for any particular bit i the propagate signal P_(i), thegenerate signal G_(i) and the kill signal K_(i) are mutually exclusive.No two of these signals occurs simultaneously.

The construction of each bit circuit 400 enables arithmetic logic unit230 to perform any one of 256 possible 3 input Boolean functions or anyone of 256 possible 3 input mixed Boolean and arithmetic functionsdepending upon the inverted function signals F7-F0. The nine inputsincluding the arithmetic enable signal and the inverted function signalsF7-F0 permit the selection of 512 functions. As will be furtherdescribed below the data paths of data unit 110 enable advantageous useof three input arithmetic logic unit 230 to speed operations in manyways.

Table 20 lists the simple Boolean logic functions of bit circuit 400 inresponse to single function signals F7-F0. Since these are Boolean logicfunctions and the arithmetic enable signal is "0", both the generate andkill functions are disabled. Note that for Boolean extended arithmeticlogic unit operations it is possible to specify the carry-in signalsc_(in0) and c_(in1) from bit 0 carry-in generator 246 as previouslydescribed, thus permitting a carry ripple.

                  TABLE 20                                                        ______________________________________                                        8-bit ALU Function        Logical                                               code field Signal Operation                                                 ______________________________________                                        58        F7               A &  B &  C                                          57 F6 ˜A &  B &  C                                                      56 F5  A & ˜B &  C                                                      55 F4 ˜A & ˜B &  C                                                54 F3  A &  B & ˜C                                                      53 F2 ˜A &  B & ˜C                                                52 F1  A & ˜B & ˜C                                                51 F0 ˜A & ˜B & ˜C                                        ______________________________________                                    

These functions can be confirmed by inspecting FIGS. 20 and 21. For theexample of F7="1" and F6-F0 all equal to "0", invertors 441, 442, 443,444, 446, 447 and 448 each output a "0". Only invertor 445 produces a"1" output. The propagate signal is "1" only if C_(i) ="1" turning onpass gate 455, B_(i) ="1" turning on pass gate 463 and A_(i) ="1"turning on pass gate 472. All other combinations result in a propagatesignal of "0". Since this is a logical operation, both the zero carry-insignal c_(in0) and the one carry-in signal c_(in1) are "0". Thus S_(i)="1" because both exclusive OR circuits 431 and 433 return the propagatesignal. The other entries on Table 20 may be similarly confirmed.

A total of 256 Boolean logic functions of the three inputs A, B and Care enabled by proper selection of function signals F7-F0. Note that thestate table of three inputs includes 8 places, thus there are 2⁸ =256possible Boolean logic functions of three inputs. Two input functionsare subset functions achieved by selection of function signals F7-F0 inpairs. Suppose that a Boolean function of B and C, without relation toinput A, is desired. Selection of F7=F6, F5=F4, F3=F2 and F1=F0 assuresindependence from input A. Note that the branches of Boolean functiongenerator 403 connected to pass gates 471 and 472 are identicallydriven. This ensures that the result is the same whether A₁ ="1" or A₁="0". Such a selection still provides 4 controllable function pairspermitting specification of all 16 Boolean logic functions of inputs Band C. Note that the state table of two inputs includes four places,thus there are 2⁴ =16 possible Boolean logic functions of three inputs.Similarly, selection of F7=F5, F6=F4, F3=F1 and F2=F0 ensuresindependence from input B and provides 4 controllable function pairs forspecification of 16 Boolean logic functions of inputs A and C. Selectionof F7=F3, F6=F2, F5=F1 and F4=F0 permits selection via 4 controllablefunction pairs of 16 Boolean logic functions of inputs A and Bindependent of input C.

The instruction word determines the function performed by arithmeticlogic unit 230 and whether this operation is arithmetic or Booleanlogic. As noted in Table 20, the instruction word includes a field codedwith the function signals for Boolean logic operations. This field, the"8 bit arithmetic logic unit" field (bits 58-51) of the instructionword, is directly coded with the function signals when the instructionspecifies a Boolean logic operation for arithmetic logic unit 230.

The "8 bit arithmetic logic unit" field is differently coded when theinstruction specifies arithmetic operations. Study of the feasiblearithmetic functions indicates that a subset of these arithmeticfunctions specify the most often used operations. If the set of functionsignals F7-F0 is expressed as a two place hexadecimal number, then thesemost often used functions are usually formed with only the digits a, 9,6 and 5. In these sets of function signals F7=˜F6, F5=˜F4, F3=˜F2 andF1=˜F0. Bits 57, 55, 53 and 51 specify fifteen operations, with an "8bit arithmetic logic unit" field of all zeros reserved for the specialcase of non-arithmetic logic unit operations. Non-arithmetic logic unitoperations will be described below. When executing an arithmeticoperation function signal F6=bit 57, function signal F4=bit 55, functionsignal F4=bit 53 and function signal F2=bit 51. The other functionsignals are set by F7=˜F6, F5=˜F4, F3=˜F2 and F1=˜F0. These operationsand their corresponding function signals are shown in Table 21. Table 21also shows the modifications to the default coding.

                  TABLE 21                                                        ______________________________________                                        8-bit ALU Derived                                                               code field Function Signal                                                  5 5 5 5   FFFFFFFF                                                              7 5 3 1 76543210 Hex Description of operation                               ______________________________________                                        0 0 0 0   10101010  AA       reserved for non-arithmetic                           logic unit operations                                                      0 0 0 1 10101001 A9 A-B shift left "1" extend                                 0 0 1 0 10100110 A6 A+B shift left "0" extend                                 0 0 1 1 10100101 A5 A-C                                                       0 1 0 0 10011010 9A A-B shift right "1" extend                                   if sign=0 flips to 95                                                         A-B shift right sign                                                          extend                                                                     0 1 0 1 10011001 99 A-B                                                       0 1 1 0 10010110 96 A+B/A-B depending on C                                       if ˜@MF flips to 99 A-B                                                 if sign=1 A+|B|                                          0 1 1 1 10010101 95 A-B shift right "0" extend                                1 0 0 0 01101010 6A A+B shift right "0" extend                                1 0 0 1 01101001 69 A-B/A+B                                                      if ˜@MF flips to 66 A+B                                                 if sign=1 A-|B|                                          1 0 1 0 01100110 66 A+B                                                       1 0 1 1 01100101 65 A+B shift right "1" extend                                   if sign=0 flips to 6A                                                         A+B shift right sign                                                          extend                                                                     1 1 0 0 01011010 5A A+C                                                       1 1 0 1 01011001 59 A-B shift left "0" extend                                 1 1 1 0 01010110 56 A+B shift left "1" extend                                 1 1 1 1 01100000 60 (A&C)+(B&C), field A+B                                  ______________________________________                                    

Several codings of instruction word bits 57, 55, 53 and 51 are executedin modified form as shown in Table 21. Note that the functions that listleft or right shifts are employed in conjunction with barrel rotator 235and mask generator 238. These operations will be explained in detailbelow. The "sign" referred to in this description is bit 31 ofarithmetic logic unit second input bus 206, the bus driving barrelrotator 235. This is the sign bit of a signed number. A "0" in this signbit indicates a positive number and a "1" in this sign bit indicates anegative (two's complement) number. A bit 57, 55, 53 and 51 state of"0100" results in a normal function of A-B with shift right "1" extend.If bit 31 of arithmetic logic unit second input bus 206 is "0", then theoperation changes to A-B with shift right sign extend. A bit 57, 55, 53and 51 state of "0110" results in a normal function of A-B or A+Bdepending on the bit wise state of C. If the instruction does notspecify a multiple flags register mask operation (@MF) then theoperation changes to A-B. If bit 31 of arithmetic logic unit secondinput bus 206 is "1", then the operation changes to A+|B| (A plus theabsolute value of B). A bit 57, 55, 53 and 51 state of "1011" results ina normal function of A+B or A-B depending on the bit wise state of C. Ifthe instruction does not specify a multiple flags register maskoperation (˜@MF) then the operation changes to A+B. If bit 31 ofarithmetic logic unit second input bus 206 is "1", then the operationchanges to A-|B| (A minus the absolute value of B). A bit 57, 55, 53 and51 state of "1001" results in a normal function of A+B with shift right"1" extend. If bit 31 of arithmetic logic unit second input bus 206 is"0", then the operation changes to A+B with shift right sign extend.

Two codes are modified to provide more useful functions. A bit 57, 55,53 and 51 state of "0000" results in a normal function of ˜A (not A),which is reserved to support non-arithmetic logic unit operations asdescribed below. A bit 57, 55, 53 and 51 state of "1111" results in anormal function of A. This is modified to (A&C)+(B&C) or a field add ofA and B controlled by the state of C.

The base set of operations listed in Table 21 may be specified inarithmetic instructions. Note that instruction word bits 58, 56, 54 and52 control modifications of these basic operations as set forth in Table6. These modifications were explained above in conjunction with Table 6and the description of status register 210. As further described belowcertain instructions specify extended arithmetic logic unit operations.It is still possible to specify each of the 256 arithmetic operationsvia an extended arithmetic logic unit (EALU) operation. For theseinstructions the "A" (bit 27) of data register D0 specifies either anarithmetic or Boolean logic operation, the "EALU" field (bits 26-19)specifies the function signals F7-F0 and the "FMOD" field (bits 31-28)specifies modifications of the basic function. Also note that the "C","I", "S", "N" and "E" fields of data register D0 permit control of thecarry-in to bit 0 of arithmetic logic unit 230 and to the leastsignificant bit of each section if multiple arithmetic is enabled. Thereare four forms of extended arithmetic logic unit operations. Two ofthese specify parallel multiply operations using multiplier 220. In anextended arithmetic logic unit true (EALUT) operation, the functionsignals F7-F0 equal the corresponding bits of the "EALU" field of dataregister D0. In an extended arithmetic logic unit false (EALUF)operation, the individual bits of the "EALU" field of data register D0are inverted to form the function signals F7-F0. The extended arithmeticlogic unit false operation is useful because during some algorithms theinverted functions signals perform a useful related operation. Invertingall the function signals typically specifies an inverse function. Thusthis related operation may be accessed via another instruction withoutreloading data register 208. In the other extended arithmetic logic unitoperations the function signals F7-F0 equal the corresponding bits ofthe "EALU" field of data register D0, but differing data paths toarithmetic logic unit 230 are enabled. These options will be explainedbelow.

Data unit 110 operation is responsive to instruction words fetched byprogram flow control unit 130. Instruction decode logic 250 receivesdata corresponding to the instruction in the execute pipeline stage viaopcode bus 133. Instruction decode logic 250 generates control signalsfor operation of multiplexers Fmux 221, Imux 222, MSmux 225, Bmux 227,Amux 232, Cmux 233, Mmux 234 and Smux 231 according to the receivedinstruction word. Instruction decode logic 250 also controls operationof buffers 104, 106, 108, 223 and 236 according to the receivedinstruction word. Control lines for these functions are omitted for thesake of clarity. The particular controlled functions of the multiplexersand buffers will be described below on description of the instructionword formats in conjunction with FIG. 43. Instruction decode logic 250also supplies partially decoded signals to function signal generator 245and bit 0 carry-in generator 246 for control of arithmetic logic unit230. Particular hardware for this partial decoding is not shown,however, one skilled in the art would be able to provide these functionsfrom the description of the instruction word formats in conjunction withFIG. 43. Instruction decode logic 250 further controls the optionalmultiple section operation of arithmetic logic unit 230 by control ofmultiplexers 311, 312, 313 and 314, previously described in conjunctionwith FIG. 7.

FIG. 22 illustrates details of the function signal selector 245a.Function signal selector 245a forms a part of function signal generator245 illustrated in FIG. 5. For a full picture of function signalgeneration, FIG. 22 should be considered with the function signalmodifier 245b illustrated in FIG. 23. Multiplexers are shown byrectangles having an arrow representing the flow of bits from inputs tooutputs. Inputs are designated with lower case letters. Control linesare labeled with corresponding upper case letters drawn entering themultiplexer rectangle perpendicular to the arrow. When a control linedesignated with a particular upper case letter is active, then the inputhaving the corresponding lower case letter is selected and connected tothe output of the multiplexer.

Input "a" of multiplexer Omux 500 receives an input in two parts. Bits57, 55, 53 and 51 of the instruction word are connected to bit lines 6,4, 2 and 0 of input "a", respectively. Invertor 501 inverts therespective instruction word bits and supplies them to bit lines 7, 5, 3and 1 of input "a". Input "a" is selected if control line "A" goesactive, and when selected the eight input bit lines are connected totheir eight corresponding numbered output bit lines 7-4 and 3-0. Controlline "A" is fed by AND gate 502. AND gate 503 receives a first inputindicating execution of an instruction in any of the instruction classes7-0. Instruction word bit 63 indicates this. These instruction classeswill be further described below. AND gate 502 has a second input fed bybit 59 of the instruction word. As will be explained below, a bit 59equal to "1" indicates an arithmetic operation. NAND gate 503 supplies athird input to AND gate 502. NAND gate 503 senses when any of the fourinstruction word bits 57, 55, 53 or 51 is low. Control input "A" is thusactive when any of the instruction classes 7-0 is selected, andarithmetic bit 59 of the instruction word is "1" and instruction wordbits 57, 55, 53 and 51 are not all "1'". Recall from Table 21 that a bit57, 55, 53 and 51 state of "1111" results in the modified functionsignals Hex "60" rather than the natural function signals.

Input "b" to multiplexer Omux 500 is a constant Hex "60". MultiplexerOmux 500 selects this input if AND gate 504 makes the control "B"active. AND gate 504 makes control "B" active if the instruction iswithin classes 7-0 as indicate by instruction word bit 63, theinstruction word bit 59 is "1" indicating an arithmetic operation, and abit 57, 55, 53 and 51 state of "1111". As previously described inconjunction with Table 21, under these conditions the function Hex "60"is substituted for the function signals indicated by the instruction.

Input "c" to multiplexer Omux 500 receives all eight instruction wordbits 58-51. Multiplexer Omux 500 selects this input if AND gate 505makes control "C" active. AND gate 505 receives instruction word bit 59inverted via invertor 506 and an indication of any of the instructionclasses 7-0. Thus instruction word bits 58-51 are selected to performany of the 256 Boolean operations in instruction classes 7-0.

Instruction words for the operations relevant to control inputs "D","E", "F", "G" and "H" have bits 63-61 equal to "011". If this conditionis met, then bits 60-57 define the type of operation. These operationsare further described below in conjunction with Table 35.

Input "d" to multiplexer Omux 500 is a constant Hex "66". This input isselected for instructions that execute a parallel signed multiply andadd (MPYS ∥ ADD) or a parallel unsigned multiply and add (MPYU ∥ ADD).These instructions are collectively referred to by the mnemonic MPYx ∥ADD.

Input "e" to multiplexer Omux 500 is a constant Hex "99". This input isselected for instructions that execute a parallel signed multiply andsubtract (MPYS ∥ SUB) or a parallel unsigned multiply and subtract (MPYU∥ SUB). These instructions are collectively referred to by the mnemonicMPYx ∥ SUB.

Input "f" to multiplexer Omux 500 is a constant Hex "A6". This input isselected for the DIVI operation. The operation of this DIVI operation,which is employed in division, will be further described below.

Input "g" to multiplexer Omux 500 is supplied from the "EALU" field(bits 26-19) of data register D0 according to an extended arithmeticlogic unit-function code from bits 26-19 therein. Control input "G" goesactive to select this "EALU" field from data register D0 if OR gate 507detects either a MPYX ∥ EALUT operation or and an EALU operation. Aspreviously described, the T suffix in EALUT signifies EALU code true incontrast to the inverse (false) in EALUF. The EALU input is active tocontrol input "G" when the "EALU" field of data register D0 indicateseither EALU or EALU%.

Invertor 508 inverts the individual bits of the "EALU" field of dataregister D0 for supply to input "h" of multiplexer Omux 500. Input "h"of multiplexer Omux 500 is selected in response to detection of a MPYx ∥EALUF operation at control input "H". As previously described, the Fsuffix of EALUF indicates that the individual bits of the "EALU" fieldof register D0 are inverted for specification of function signals F7-F0.

Multiplexer AEmux 510, which is also illustrated in FIG. 22, generatesthe arithmetic enable signal. This arithmetic enable signal is suppliedto tri-state AND gate 480 of every bit circuit 400. The "a" input tomultiplexer AEmux 510 is the "A" bit (bit 27) of data register D0. ORgate 511 receives three inputs: MPYx ∥ EALUT, EALU, and MPYx ∥ EALUF. Ifthe instruction selects any of these three operations, then controlinput "A" to multiplexer AEmux selects the "A" bit (bit 27) of dataregister D0. The "b" input to multiplexer AEmux 510 is the "ari" bit(bit 59) of the instruction word. As will be described below, this "ari"bit selects arithmetic operations for certain types of instructions.This input is selected if the instruction is any of the instructionclasses 7-0. In this case the "ari" bit signifying an arithmeticoperation ("ari"="1") or a Boolean operation ("ari"="0") is passeddirectly to the arithmetic logic unit 230. The "c" input of multiplexerAEmux 510 is a constant "1". The gate 512 selects this input if theinstruction is neither an extended arithmetic logic unit instruction norwithin instruction classes 7-0. Such instructions include the DIVIoperation and the MPYx ∥ ADD and MPYx ∥ SUB operations. OR gate 513provides an arithmetic or EALU signal when the instruction is either anarithmetic operation as indicated by the output of multiplexer AEmux 510or an "any EALU" operation as indicated by OR gate 511.

FIG. 23 illustrates function signal modifier 245b. Function signalmodifier 245b modifies the function signal set from function signalgenerator 245a according to the "FMOD" field of data register D0 or theinstruction bits 58, 56, 54 and 52 depending on the instruction.Multiplexer Fmux 520 selects the function modifier code.

The "a" input to multiplexer Fmux 520 is all "0's" (Hex "0"). NOR gate521 supplies control line "A" of multiplexer Fmux 520. NOR gate 521 hasa first input receiving the "any EALU" signal from OR gate 511illustrated in FIG. 22 and a second input connected to the output of ANDgate 522. AND gate 522 receives a first input from the "ari" bit (bit59) of the instruction word and a second input indicating theinstruction is in instruction classes 7-0. Thus NOR gate 521 generatesan active output that selects the Hex "0" input to Fmux 520 if theinstruction is not any extended arithmetic logic unit operation andeither the "ari" bit of the instruction word is "0" or the instructionis not within instruction classes class 7-0.

The "b" input to multiplexer Fmux 520 receives bits 58, 56, 54 and 52 ofthe instruction word. The control input "B" receives the output of ANDgate 522. Thus multiplexer Fmux 520 selects bits 58, 56, 54 and 52 ofthe instruction word when the instruction is in any instruction class7-0 and the "ari" bit of the instruction is set.

The "c" input of multiplexer Fmux 520 receives bits of the "FMOD" field(bits 31-28) of data register D0. The control input "C" receives the"any EALU" signal from OR gate 511. Multiplexer Fmux 520 selected the"FMOD" field of data register D0 if the instruction calls for anyextended arithmetic logic unit operation.

Multiplexer Fmux 520 selects the active function modification code. Theactive function modification code modifies the function signals suppliedto arithmetic logic unit 230 as described below. The functionmodification code is decoded to control the operations specified inTable 6. As explained above, these modified operations includecontrolled splitting of arithmetic logic unit 230, setting one or morebits of multiple flags register 211 by zero(es) or carry-out(s) fromarithmetic logic unit 230, rotating or clearing multiple flags register211, operating LMO/RMO/LMBC/RMBC circuit 237 in one of its four modes,operating mask generation 239 and operating bit 0 carry-in generator246. The operations performed in relation to a particular state of thefunction modification code are set forth in Table 6.

Three circuit blocks within function modifier 245b may modify thefunction signals F7-F0 from multiplexer Omux 500 illustrated in FIG. 22.Mmux block 530 may operate to effectively set the input to the C-port toall "1's". A-port block 540 may operate to effectively set the input tothe A-port to all "0's". Sign extension block 550 is a sign extensionunit that may flip function signals F3-F0.

Mmux block 530 includes a multiplexer 531 that normally passes functionsignals F3-F0 without modification. To effectively set the input to theC-port of arithmetic logic unit 230 to "1's", multiplexer 531 replicatesfunction signals F7-F4 onto function signals F3-F0. Multiplexer 531 iscontrolled by AND gate 533. AND gate 533 is active to effectively setthe input to the C-port to all "1's" provided all three of the followingconditions are present: 1) the function modifier code multiplexer Fmux520 is any of the four codes "0010", "0011", "0110" or "0111" asdetected by "0X1X" match detector 532 (X=don't care); 2) the instructioncalls for a mask generation operation; and 3) the output frommultiplexer Mmux 234 is "0". As previously described above, duplicationof functions signals F7-F4 onto function signals F3-F0, that isselection of F7=F3, F6=F2, F5=F1 and F4=F0, enables selection of the 16Boolean logic functions of inputs A and B independent of input C. Notefrom Table 6 that the four function modifier codes "0X1X" include the"%!" modification. According to FIG. 23, the "%!" modification isachieved by changing the function signals sent to arithmetic logic unit230 rather than by changing the mask generated by mask generator 239.

A-port block 540 includes multiplexer 541 and connection circuit 542that normally pass function signals F7-F0 without modification. Toeffectively set the input to the A-port of arithmetic logic unit 230 toall "0's", multiplexer 541 and connection circuit 541 replicatesfunction signals F6, F4, F2 and F0 onto function signals F7, F5, F3 andF1, respectively. Multiplexer 541 and connection circuit 542 make thissubstitution when activated by OR gate 544. OR gate 544 has a firstinput connected to "010X" match detector 543, and a second inputconnected to AND gate 546. AND gate 546 has a first input connected to"011X" match detector 545. Both match detectors 543 and 545 determinewhether the function modifier code matches their detection state. ANDgate 546 has a second input that receives a signal indicating whetherthe instruction calls for a mask generation operation. The input to theA-port of arithmetic logic unit 230 is effectively zeroed by swappingfunction signals F6, F4, F2 and F0 for function signals F7, F5, F3 andF1, respectively. As previously described, this substitution makes theoutput of arithmetic logic unit 230 independent of the A input. Thissubstitution takes place if: 1) the function modifier code finds a matchin "010X" match detector 543; or 2) the instruction calls for a maskgeneration operation and the function modifier code find a match in"010X" match detector 545 and the instruction calls for a maskgeneration operation.

Sign extension block 550 includes exclusive OR gate 551, which normallypasses function signals F3-F0 unmodified. However, these functionsignals F3-F0 are inverted for arithmetic logic unit sign extension andabsolute value purposes under certain conditions. Note that functionsignals F7-F4 from A-port block 540 are always passed unmodified by signextension block 550. AND gate 552 controls whether exclusive OR gate 551inverts function signals F3-F0. AND gate 552 has a first input receivingthe arithmetic or extended arithmetic logic unit signal from OR gate 513illustrated in FIG. 22. The second input to AND gate 552 is frommultiplexer 553.

Multiplexer 553 is controlled by the "any EALU" signal from OR gate 511of FIG. 22. Multiplexer 553 selects a first signal from AND gate 554when the "any EALU" signal is active and selects a second signal fromcompound AND/OR gate 556 when the "any EALU" signal is inactive. Theoutput of AND gate 554 equals "1" when the data on arithmetic logic unitsecond input bus 206 is positive, as indicated by the sign bit (bit 31)as inverted by invertor 555, and the "S" bit (bit 16) of data registerD0 is "1". The output of compound AND/OR gate 556 is active if: 1) thedata on arithmetic logic unit second input bus 206 is positive, asindicated by the sign bit (bit 31) as inverted by invertor 555; 2) theinstruction is within instruction classes 7-0; and 3) either a)instruction bits 57, 55, 53 and 51 find a match in "0100"/"1011" matchdetector 557 or b) AND gate 560 detects that instruction word bits 57,55, 53 and 51 find a match in "1001"/"0110" match detector 558, and theinstruction does not call for a multiple flags register mask operation(@MF) as indicated by invertor 559.

Sign extension block 550 implements the exceptions noted in Table 21. Aninactive "any EALU" signal, which indicates that the instructionspecified an arithmetic operation, selects the second input tomultiplexer 553. Compound AND/OR gate 556 determines that theinstruction is within instruction classes 7-0 and that the sign bit is"0". Under these conditions, if instruction word bits 57, 55, 53 and 51equal 0100" and then the function signal flips from Hex "9a" to Hex "95"by inverting function signal bits F3-F0. Similarly, if instruction wordbits 57, 55, 53 and 51 equal "1011" and then the function signal flipsfrom Hex "65" to Hex "6a" by inverting function signal bits F3-F0. Ifinstruction word bits 57, 55, 53 and 51 equal "1001" and the instructiondoes not call for a multiple flags register mask operation as indicatedby invertor 599, then the function signal flips from Hex "69" to Hex"66". This set of function signals causes arithmetic logic unit 230 toimplement A-|B|, A minus the absolute value of B. If instruction wordbits 57, 55, 53 and 51 equal "0110" and the instruction does not callfor a multiple flags register mask operation, then the function signalflips from Hex "96" to Hex "99". This executes the function A+|B|, Aplus the absolute value of B. Note that these flips of the functionsignals are based on the sign bit (bit 31) of the data on arithmeticlogic unit second input bus 206.

FIG. 24 illustrates bit 0 carry-in generator 246. As previouslydescribed bit, 0 carry-in generator 246 produces the carry-in signalc_(in) supplied to the first bit of arithmetic logic unit 230. Inaddition this carry-in signal c_(in) from bit 0 carry-in generator 246is generally supplied to the first bit of each of the multiple sections,if the instruction calls for a multiple arithmetic logic unit operation.Multiplexer Zmux 570 selects one of six possible sources for this bit 0carry-in signal c_(in) based upon six corresponding controls inputs frominstruction decode logic 250.

Input "a" of multiplexer Zmux 570 is supplied with bit 31 of multipleflags register 211. Multiplexer Zmux 570 selects this input as the bit 0carry-in signal c_(in) if the instruction calls for a DIVI operation.

Inputs "b", "c" and "d" to multiplexer Zmux 570 are formed of compoundlogic functions. Input "b" of multiplexer Zmux 570 receives a signalthat is a Boolean function of the function signals F6, F2 and F0. ThisBoolean expression, which is formed by circuit 571, is (F0 & ˜F6) | (F0& ˜F2) | (˜F2 & ˜F6). Input "c" of multiplexer Zmux 570 is fed byexclusive OR gate 572, which has a first input supplied by exclusive ORgate 573 and a second input supplied by AND gate 574. The exclusive ORgate 573 has as a first input the "C" bit (bit 18) of data register D0,which indicates whether the prior operation of arithmetic logic unit 230produced a carry-out signal c_(out) at bit 31, the last bit. The secondinput of XOR gate 573 receives a signal indicating the instruction callsfor a MPYx ∥ EALUF operation. AND gate 574 has a first input frominvertor 575 inverting the sign bit (bit 31) present on arithmetic logicunit second input bus 206 for detecting a positive sign. AND gate 574has a second input from the "I" bit (bit 17) of data register D0 and athird input from the "S" bit (bit 16) of data register D. As explainedabove, the "I" bit causes inversion of carry-in when the "S" bitindicates sign extend is enabled. This operation complements the signextend operation of AND gate 554 and XOR gate 551 of the functionmodifier 246b illustrated in FIG. 23. Input "d" of multiplexer Zmux 570comes from XOR gate 576. XOR gate 576 has a first input supplied thefunction signal F0 and a second input supplied bit 0 of the data oninput C bus 243.

Input "b" of multiplexer Zmux 570 is selected when AND gate 581 setscontrol input "B" active. This occurs when the "arithmetic or EALU" fromOR gate 513 is active, the instruction does not call for an extendedarithmetic logic unit operation as indicated by invertor 582 and noother multiplexer Zmux 570 input is applicable as controlled byinvertors 583, 584 and 585.

Input "c" of multiplexer Zmux 570 is selected when AND gate 586 suppliesan active output to control input "C". AND gate 586 is responsive to asignal indicating the instruction calls for "any EALU" operation. Therest of the inputs to AND gate 586 assure that AND gate 586 is notactive if any of inputs "d", "e" or "f" are active via invertors 584,585 and 595.

Input "d" of multiplexer Zmux 570 is selected when control line "D" isfrom AND gate 587. AND gate 587 is active when the instruction is anarithmetic operation or an extended arithmetic logic unit operation, ANDgate 589 is active and input "e" is not selected as indicated byinvertor 585. AND gate 589 is active when the instruction specifies amultiple flags register mask- operation (@MF) expansion and instructionword bits 57, 55, 53 and 51 find a match in "0110"/"1001", match circuit588. These instruction word bits correspond to function signals Hex "69"and Hex "96", which cause addition or subtraction between ports A and Bdepending on the input to port C. No function signal flipping isinvolved since the instruction class involves multiple flags registerexpansion. FIG. 7 illustrates providing this carry-in signal to pluralsections of a split arithmetic logic unit in multiple mode.

Input "e" of multiplexer Zmux 570 comes from the "C" bit (bit 30) ofstatus register 210. As previously described, this "C" bit of statusregister 210 is set to "1" if the result of the last operation ofarithmetic logic unit 230 caused a carry-out from bit 31. AND gate 594supplies control input "E". AND gate 594 goes active when theinstruction specifies an arithmetic operation or an extended arithmeticlogic unit operation and the following logic is true: 1) the functionmodifier code finds a match in "0X01" match detector 591; or (OR gate590) 2) the instruction calls for a mask generation operation and (ANDgate 593) the function modifier code finds a match in "0X11" matchdetector 592.

Input "f" of multiplexer Zmux 570 is supplied with a constant "0".Multiplexer Zmux 570 selects this input when the "arithmetic or EALU"signal from OR gate 513 indicates the instruction specifies a Booleanoperation as inverted by invertor 595.

The output of Zmux 570 normally passes through Ymux 580 unchanged andappears at the bit 0 carry-in output. In a multiple arithmetic operationin which data register D0 "A" bit (bit 27) and "E" bit (bit 14) are notboth "1", Ymux produces plural identical carry-in signals. Selection ofhalf word operation via "Asize" field of status register 210 causes Ymuxto produce the supply the output of Zmux 570 to both the bit 0 carry-inoutput and the bit 16 carry-in output. Likewise, upon selection of byteoperation Ymux 580 supplies the output of Zmux 570 to the bit 0 carry-inoutput, the bit 8 carry-in output, the bit 16 carry-in output and thebit 24 carry-in output.

The operation of Ymux 580 differs when data register D0 "A" bit (bit 27)and "E" bit (bit 14) are both "1". AND gate 577 forms this condition andcontrols the operation of Ymux 580. This is the only case in which thecarry-in signals supplied to different sections of arithmetic logic unit230 during multiple arithmetic differ. If AND gate 577 detects thiscondition, then the carry-in signals are formed by the exclusive OR offunction signal F0 and the least significant bit of the C input of thecorresponding section of arithmetic logic unit 230. If the "Asize" fieldselects word operation, that is if arithmetic logic unit 230 forms asingle 32 bit section, then the bit 0 carry-in output formed by Ymux 580is the exclusive OR of function signal F0 and input C bus bit 0 formedby XOR gate 596. No other carry-in signals are formed. If the "Asize"field selects half word operation forming two 16 bit sections, then thebit 0 carry-in output formed by Ymux 580 is the output of XOR gate 596and the carry-in to bit 16 is the exclusive OR of function signal F0 andinput C bus bit 16 formed by XOR gate 598. Lastly, for byte multiplearithmetic the bit 0 carry-in output formed by Ymux 580 is the output ofXOR gate 596, the bit 8 carry-in is formed by XOR gate 597, and the bit16 carry-in is formed by XOR gate 598 and the bit 24 carry-in is formedby XOR gate 599.

FIGS. 22, 23 and 24 not only represent specific blocks implementing theTables but also illustrates the straightforward process by which theTables and Figures compactly define logic circuitry to enable theskilled worker to construct the preferred embodiment even when a blockdiagram of particular circuitry may be absent for conciseness. Note thatthe circuits of FIGS. 22 and 23 do not cover control for the variousmultiplexers and special circuits via instruction decode logic 250 thatare a part of data unit 110 illustrated in FIG. 5. However, control ofthese circuits is straight forward and within the capability of one ofordinary skill in this art. Therefore these will not be furtherdisclosed for the sake of brevity.

Arithmetic logic unit 230 includes three 32 bit inputs having differinghardware functions preceding each input. This permits performance ofmany different functions using arithmetic logic unit 230 to combineresults from the hardware feeding each input. Arithmetic logic unit 230performs Boolean or bit by bit logical combinations, arithmeticcombinations and mixed Boolean and arithmetic combinations of the 3inputs. Mixed Boolean and arithmetic functions will hereafter be calledarithmetic functions due to their similarity of execution. Arithmeticlogic unit 230 has one control bit that selects either Boolean functionsor arithmetic functions. Boolean functions generate no carries out of orbetween bit circuits 400 of arithmetic logic unit 230. Thus each bitcircuit 400 of arithmetic logic unit 230 combines the 3 inputs to thatbit circuit independently forming 32 individual bit wise results. Duringarithmetic functions, each bit circuit 400 may receive a carry-in fromthe adjacent lesser significant bit and may generate a carry-out to thenext most significant bit location. An 8 bit control signal (functioncontrol signals F7-F0) control the function performed by arithmeticlogic unit 230. This enables selection of one of 256 Boolean functionsand one of 256 arithmetic functions. The function signal numbering offunction signals F7-F0 is identical to that used in Microsoft® Windows.Bit 0 carry-in generator 246 supplies carry-in signals when inarithmetic mode. In arithmetic mode, arithmetic logic unit 230 may besplit into either two independent 16 bit sections or four independent 8bit sections to process in parallel multiple smaller data segments. Bit0 carry-in generator 246 supplies either one, two or four carry-insignals when arithmetic logic unit 230 operates in one, two or foursections, respectively. In the preferred embodiment, an assemblier fordata unit 110 includes an expression evaluator that selects the properset of function signals based upon an algebraic input syntax.

The particular instruction being executed determines the function ofarithmetic logic unit 230. As will be detailed below, in the preferredembodiment the instruction word includes a field that indicates eitherBoolean or arithmetic operations. Another instruction word fieldspecifies the function signals supplied to arithmetic logic unit 230.Boolean instructions specify the 8 function signals F7-F0 directly. Inarithmetic instructions a first subset of this instruction word fieldspecifies a subset of the possible arithmetic logic unit operationsaccording to Table 21. A second subset of this instruction word fieldspecifies modifications of instruction function according to Table 6.All possible variations of the function signals and the functionmodifications for both Boolean and arithmetic instructions may bespecified using an extended arithmetic logic unit (EALU) instruction. Inthis case the predefined fields within data register D0 illustrated inFIG. 9 specify arithmetic logic unit 230 operation.

Though arithmetic logic unit 230 can combine all three inputs, manyuseful functions don't involve some of the inputs. For example theexpression A&B treats the C input as a don't care, and the expressionA|C treats the B input as a don't care. Because different data pathhardware precedes each input, the ability to use or ignore any theinputs supports the selection of data path hardware needed for thedesired function. Table 22 shows examples of useful three inputexpressions where the C-input is treated as a mask or a merging control.Because data unit 110 includes expand circuit 238 and mask generator 239in the data path of the C-input of arithmetic logic unit 230, it isnatural to employ the C-input as a mask.

                  TABLE 22                                                        ______________________________________                                        Logical                                                                         Function Typical use                                                        ______________________________________                                         (A&C) | (B&˜C)                                                              Bit by bit multiplexing (merge) of                                 A and B based on C. A chosen if                                               corresponding bit in C is 1                                                  (A&˜C) | (B&C) Bit by bit multiplexing (merge) of                            A and B based on C. B chosen if                                  corresponding bit in C is 1                                                  (A|B)&˜C Logic OR of A and B and then force                     to 0 everywhere that C is a 1                                                (A&B)&˜C Logic AND of A and B and then force                             to 0 everywhere C is a 1                                                     A| (B&C) If C is 0 then force the B-input to                          0 before logical ORing with A                                                A| (B| ˜C) If C is 0 then force the B-input to                      1 before logical ORing with A                                 ______________________________________                                    

The three input arithmetic logic unit 230 can perform mixed Boolean andarithmetic functions in a single pass through arithmetic logic unit 230.The mixed Boolean and arithmetic functions support performing Booleanfunctions prior to an arithmetic function. Various compound functionssuch as shift and add, shift and subtract or field masking prior toadding or subtracting can be performed by the appropriate arithmeticlogic unit function in combination with other data path hardware. Notearithmetic logic unit 230 supports 256 different arithmetic functions,but only a subset of these will be needed for most programming.Additionally, further options such as carry-in and sign extension needto be controlled. Some examples expected to be commonly used are listedbelow in Table 23.

                  TABLE 23                                                        ______________________________________                                        Func                                                                            Code  Default                                                                 Hex Function Carry-In Common Use                                            ______________________________________                                        66   A + B           0         A + B ignore C                                   99 A - B 1 A - B ignore C                                                     5A A + C 0 A + C ignore B                                                     A5 A - C 1 A - C ignore B                                                     6A A + (B&C) 0 A + B shift right                                                 "0" extend                                                                    C shift mask                                                               95 A - (B&C) 1 A - B shift right                                                 "0" extend                                                                    C shift mask                                                               56 A + (B|C) 0 A + B shift left                                         "0" extend                                                                    C shift mask                                                               A9 A - (B|C) 1 A - B shift left                                         "1" extend                                                                    C shift mask                                                               A6  A + (B&˜C) 0 A + B shift left                                          "0" extend                                                                    C shift mask                                                               59  A - (B&˜C) 1 A - B shift left                                          "0" extend                                                                    C shift mask                                                               65   A + (B| ˜C) 0 A + B shift right                              sign extend                                                                   C shift mask                                                               9A   A - (B| ˜C) 1 A - B shift right                              sign extend                                                                   C shift mask                                                               60 (A&C) + (B&C) 0 A + B mask by C                                            9F (A&C) - (B&C) 1 A - B mask by C                                            06 (A&˜C) + (B&˜C) 0 A + B mask by ˜C                       F9 (A&˜C) - (B&˜C) 1 A - B mask by ˜C                       96 A + ((-B&C) | (B&˜C)) LSB of C  A + B or A - B                                               based on ˜C                            69 A + ((B&C) | (-B&˜C)) LSB of ˜C A + B or A - B                                         based on C                                   CC  B 0 B ignore A and C                                                      33 -B 1 Negative B                                                               ignore A and C                                                             F0  C 0 C ignore A and B                                                      0F -C 1 Negative C                                                               ignore A and B                                                             C0  (B&C) 0 B shift right                                                        "0" extend                                                                    C shift mask                                                               3F -(B&C) 1 Negative B shift                                                     right "0" extend                                                              C shift mask                                                               FC  (B| C) 0 B shift left                                               "1" extend                                                                    C shift mask                                                               03 -(B| C) 1 Negative B shift                                           left "1" extend                                                               C shift mask                                                               0C  (B&˜C) 0 B shift left                                                  "0" extend                                                                    C shift mask                                                               F3 -(B&˜C) 1 Negative B shift                                              left "0" extend                                                               C shift mask                                                               CF  (B| ˜C) 0 B shift right                                       sign extend                                                                   C shift mask                                                               30 -(B| ˜C) 1 Negative B shift                                    right sign extend                                                             C shift mask                                                               3C (-B&C) | (B&˜C) LSB of C  -B or B based on ˜C                                       C3  (B&C) | (-B&˜C) LSB of                                    ˜C B or -B based on C                    ______________________________________                                    

The most generally useful set of arithmetic functions combined withdefault carry-in control and sign extension options are availabledirectly in the instruction set in a base set of operations. These arelisted in Table 21. This base set include operations that modify thearithmetic logic unit's functional controls based on sign bits and thatuse default carry-in selection. Some examples of these are detailedbelow.

All 256 arithmetic functions along with more explicit carry-in and signextension control are available via the extended arithmetic logic unit(EALU) instruction. In extended arithmetic logic unit instructions thefunction control signals, the function modifier and the explicitcarry-in and sign extension control are specified in data register D0.The coding of data register D0 during such extended arithmetic logicunit instructions is described above in relation to FIG. 9.

Binary numbers may be designated as signed or unsigned. Unsigned binarynumbers are non-negative integers within the range of bits employed. AnN bit unsigned binary number may be any integer between 0 and 2^(N) -1.Signed binary numbers carry an indication of sign in their mostsignificant bit. If this most significant bit is "0" then the number ispositive or zero. If the most significant bit is "1" then the number isnegative or zero. An N bit signed binary number may be any integer from-2^(N-1) -1 to 2^(N-1) -1. Knowing how and why numbers produce a carryout or overflow is important in understanding operation of arithmeticlogic unit 230.

The sum of two unsigned numbers overflows if the sum can no longer beexpressed in the number of bits used for the numbers. This state isrecognized by the generation of a carry-out from the most significantbit. Note that arithmetic logic unit 230 may be configured to operationon numbers of 8 bits, 16 bits or 32 bits. Such carry-outs may be storedin Mflags register 211 and employed to maintain precision. Thedifference of two unsigned numbers underflows when the difference isless than zero. Note that negative numbers cannot be expressed in theunsigned number notation. The examples below show how carry-outs aregenerated during unsigned subtraction.

The first example shows 7 "00000111" minus 5 "0000110". Arithmetic logicunit 230 performs subtraction by two's complement addition. The two'scomplement of an unsigned binary number can be generated by invertingthe number and adding 1, thus -X=˜X+1. Arithmetic logic unit 230 negatesa number by logically inverting (or one's complementing) the number andinjecting a carry-in of 1 into the least significant bit. First the 5 isbit wise inverted producing the one's complement "11111001". Arithmeticlogic unit 230 adds this to 7 with a "1" injected into the carry-ininput of the first bit. This produces the following result. ##EQU2##Note that this produces a carry-out of "1" from the most significantbit. In two's complement subtraction, such a carry-out indicates anot-borrow. Thus there is no underflow during this subtraction. The nextexample shows 7-5. Note that the 8 bit one's complement of "00000111" is11111000". ##EQU3## In this case the carry-out of "0" indicates aborrow, thus the result is less than zero and an underflow has occurred.The last example of unsigned subtraction is 0-0. Note that the 8 bitone's complement of 0 is "11111111". ##EQU4## The production of acarry-out of "1" indicates no underflow.

The situation for signed numbers is more complex. An overflow on asigned add occurs if both operands are positive and the sign bit of theresult is a 1 (i.e., negative) indicating that the result has rolledover from positive to negative. Overflow on an add also occurs if bothoperands are negative and the result has a 0 (i.e., positive) sign bit.Or in other words overflow on addition occurs if both of the sign bitsof the operands are the same and the result has a different sign bit.Similarly a subtraction of can overflow if the operands have the samesign and the result has a different sign bit.

When setting the carry bit in status register 210 or in the Mflagsregister 211, the bit or bits are always the "natural" carry outsgenerated by arithmetic logic unit 230 Most other microprocessors set"carry status" based upon the carry-out bit during addition but set itbased upon not-carry-out (or borrow) during subtraction. These othermicroprocessors must re-invert the not-carry when performing subtractwith borrow to get the proper carry-in to the arithmetic logic unit.This difference results in a slightly different set of conditionalbranch equations using this invention than other processors to get thesame branch conditions. Leaving the sense of carries/not-borrows thesame as those generated by arithmetic logic unit 230 simplifies manyways in which each digital image/graphics processor can utilize them.

In the base set of arithmetic instructions, the default carry-in is "0"for addition and "1" for subtraction. The instruction set and thepreferred embodiment of the assembler will automatically set thecarry-in correctly for addition or subtraction in 32-bit arithmeticoperations. The instruction set also supports carry-in based on thestatus registers carry-out to support multiple precision add-with-carryor subtract-with-borrow operations.

As will be explained in more detail later, some functions arithmeticlogic unit 230 support the C-port controlling whether the input to theB-port is added to or subtracted from the input to the A-port. Combiningthese arithmetic logic unit functions with multiple arithmetic permitsthe input to the C-port to control whether each section of arithmeticlogic unit 230 adds or subtracts. The base set of operations controlsthe carry-in to each section of arithmetic logic unit 230 to supply acarry-in of "0" that section is performing addition and a carry-in of"1" if that section is performing subtraction. The hardware forsupplying the carry-in to these sections is described above regardingFIG. 24.

The following details the full range of arithmetic functions possibleusing digital image/graphics processor 71 3-input arithmetic logic unit230. For most algorithms, the subset of instructions listed above willbe more than adequate. The more detailed description following isincluded for completeness.

Included in the description below is information about how to derive thefunction code for arithmetic logic unit 230. Some observations aboutfunction code F7-F0 will be helpful in understanding how arithmeticlogic unit 230 can be used for various operations and how to best useextended arithmetic logic unit instructions. The default carry-in isequal to F0, the least significant bit of the function code, except forthe cases where the input to the C-port controls selection of additionor subtraction between A and B. Inverting all the function code bitschanges the sign of the operation. For example the function codes Hex"66", which specifies A+B, and Hex "99", which specifies A-B, are bitwise inverses. Similarly, function code Hex "65" (A+(B|˜C)) and Hex "9A"(A-(B|˜C)) are bit wise inverses. Extended arithmetic logic unitinstructions come in the pairs of extended arithmetic logic unit true(EALUT) and extended arithmetic logic unit false (EALUF). The extendedarithmetic logic unit false instruction inverts the arithmetic logicunit control code stored in bits 26-19 of data register D0. As notedabove, this inversion generally selects between addition andsubtraction. Inverting the 4 least significant bits of the function codeHex "6A" for A+(B&C) yields gives Hex "65" that is the functionA+(B|˜C). Similarly, inverting the 4 least significant bits of functioncode Hex "95" for A-(B&C) yields the function code Hex "9A" that isA-(B|˜C). The B&C operation zero's bits in B where C is "0" and theoperation B|˜C forces bits in B to "1" where C is "0". This achieves theopposite masking function with respect to C. As will be explained belowselectively inverting the 4 least significant bits of the function codebased on a sign bit performs sign extension before addition orsubtraction.

All the 256 arithmetic functions available employing arithmetic logicunit 230 can be expressed as:

    S=A&F1(B,C)+F2(B,C)

where: S is the arithmetic logic unit resultant; and F1(B,C) and F2(B,C)can be any of the 16 possible Boolean functions of B and C shown belowin Table

                  TABLE 24                                                        ______________________________________                                        F1      F2                                                                      Code Code Subfunction Common Use                                            ______________________________________                                        00      00     0               Zeros term                                       AA FF all 1's = -1 Sets term to all 1's                                       88 CC B B                                                                     22 33 -B-1 Negate B                                                           A0 F0 C C                                                                     0A 0F -C-1 Negate C                                                           80 C0 B&C Force bits in B to 0                                                   where C is 0                                                               2A 3F -(B&C)-1 Force bits in B to 0                                              where C is 0                                                                  and negate                                                                 A8 FC B|C Force bits in B to 1                                          where C is 1                                                               02 03 -(B|C)-1 Force bits in B to 1                                     where C is 1                                                                  and negate                                                                 08 0C B&˜C Force bits in B to 0                                            where C is 1                                                               A2 F3 -(B&˜C)-1 Force bits in B to 0                                       where C is 1                                                                  and negate                                                                 8A CF B|˜C Force bits in B to 1                                   where C is 0                                                               20 30 -(B|˜C)-1 Force bits in B to 1                              where C is 0                                                                  and negate                                                                 28 3C (B&˜C) | ((-B-1)&C) Choose B if C=all 0's                   and -B if C=all 1's                                                        82 C3 (B&C) | ((-B-1)&C) Choose B is C=all 1's                          and -B if C=all 0's                                                      ______________________________________                                    

FIG. 25 illustrates this view of arithmetic logic unit 230 in blockdiagram form. Arithmetic unit 491 forms the addition of the equation.Arithmetic unit 491 receives a carry input for bit 0 from bit 0 carry-ingenerator. The AND gate 492 forms A AND F1(B,C). Logic unit 493 formsthe subfunction F1(B,C) from the function signals as listed in Table 24.Logic unit 494 forms the subfunction F2 (B,C) from the function signalsas listed in Table 24. This illustration of arithmetic logic unit 230shows that during mixed Boolean and arithmetic operations the Booleanfunctions are performed before the arithmetic functions. A set of thebit circuits 400 illustrated in FIGS. 19, 20 and 21 together with thefunction generator illustrated in FIG. 22, the function modifierillustrated in FIG. 23 and the bit 0 carry-in generator illustrated inFIG. 24 form the preferred embodiment of the arithmetic logic unit 230illustrated in FIG. 25. Those skilled in the art would recognize thatthere are many other feasible ways to implement arithmetic logic unit230 illustrated in FIG. 25.

As clearly illustrated in FIG. 25, the subfunctions F1(B,C) and F2(B,C)are independent and may be different subfunctions for a single operationof arithmetic logic unit 230. The subfunction F2(B,C) includes both thenegative of B and the negative of C. Thus either B or C may besubtracted from A by adding its negative. The codes for the subfunctionsF1(B,C) and F2(B,C) enable derivation of the function code F7-F0 forarithmetic logic unit 230 illustrated in FIGS. 20 and 21. The functioncode F7-F0 for arithmetic logic unit 230 is the exclusive OR of thecodes for the corresponding subfunctions F1(B,C) and F2(B,C). Note thecodes for the subfunctions have been selected to provide this result,thus these subfunctions do not have identical codes for the sameoperation.

The subfunctions of Table 24 are listed with the most generally usefulways of expression. There are other ways to represent or factor eachfunction. For example by applying DeMorgan's Law, the function B|˜C isequivalent to ˜(˜B&C). Because ˜X=-X-1, ˜(˜B&C) is equivalent -(˜B&C)-1and B|˜C is equivalent to B|(-C-1). Note that the negative forms inTable 24 each have a trailing "-1" term. As explained above negativenumbers are two's complements. These are equivalent to the bit wiselogical inverse, which forms the 1's complement, minus 1. A carry-in of"1" may be injected into the least significant bit to cancel out the -1and form the two's complement. In the most useful functions with anegative subfunction, only the F2(B,C) subfunction produces a negative.

Often it will be convenient to think of the Boolean subfunctions inTable 24 as performing a masking operation. As noted in Table 24, thesubfunction B&C can be interpreted as forcing the B input value to "0"where the corresponding bit in C is "0. The subfunction B|˜C can beinterpreted as forcing the B input value to "1" for every bit where theC input is "0". Because mask generator 234 and expand circuit 238 feedthe C-port of arithmetic logic unit 230 via multiplexer 233, in mostcases the C-port will be used as a mask in subfunctions that involveboth B and C terms. Table 24 has factored the expression of eachsubfunction in terms assuming that the input to the C-port is used as amask. The equation above shows that the A-input cannot be negated in thearithmetic expression. Thus arithmetic logic unit 230 cannot subtract Afrom either B or C. On the other hand, either B or C can be subtractedfrom A because the subfunctions F1(B,C) and F2(B,C) supportnegation/inversion of B and C.

The subfunctions of Table 24 when substituted into the above equationproduces all of the 256 possible arithmetic functions that arithmeticlogic unit 230 can perform. Occasionally, some further reduction in theexpression of the resultant yields an expression that is equivalent tothe original and easier to understand. When reducing such expressions,several tips can be helpful. The base instruction set defaults to acarry-in of "0" for addition and a carry-in of "1" when the subfunctionF2(B,C) has a negative B or C term as expressed in Table 24. Thiscarry-in injection has the effect of turning the one's complement(logical inversion) into a two's complement by effectively canceling the-1 on the right hand side of the expression of these subfunctions. Thelogic AND of A all "1's" equals A. Thus subfunction F1(B,C) may be setto yield all "1's" to get A on the left side of the equation. Note alsothat all "1's" equals two's complement signed binary number minus 1(-1).

The examples below show how to use the equation and the subfunctions ofTable 24 to derive any of the possible arithmetic logic unit functionsand their corresponding function codes. The arithmetic function A+B canbe expressed as A&(all "1's")+B. This requires F1(B,C)=all "1's" andF2(B,C)=B. The F1 code for all "1's" is Hex "AA" and the F2 code for Bis Hex "CC". Bit-wise XORing Hex "AA" and Hex "CC" gives Hex "66". Table23 shows that Hex "66" is function code for A+B.

The arithmetic function A-B can be expressed as A&(all "1's")+(-B-1)+1.This implies F1(B,C)=all "1's" (F1 code Hex "AA") and F2(B,C)=-B-1 (F2code Hex "33") with a carry-in injection of "1". Recall that a carry-inof "1" is the default for subfunctions F2 that include negation.Bit-wise XORing the F1 code of Hex "AA" and with the F2 code of Hex "33"gives Hex "99". Table 23 shows that Hex "99" is the function code forA-B assuming a carry-in of "1".

The arithmetic function A+C is derived similarly to A+B. Thus A+C=A&(all"1's")+C. This can be derived by choosing F1(B,C)=all "1's" andF2(B,C)=C. The exclusive OR of the F1 code of Hex "AA" and the F2 codeof Hex "F0" produces Hex "5A" the function code for A+C. Likewise, A-Cis the same as A&(all "1's")+(-C-1)+1. The exclusive OR of the F1 codeof Hex "AA" and the F2 code of Hex "0F" produces Hex "A5" the functioncode for A-C.

Three input arithmetic logic unit 230 provides a major benefit byproviding masking and/or conditional functions between two of the inputsbased on the third input. The data path of data unit 110 enables theC-port to be most useful as a mask using mask generator 234 orconditional control input using expand circuit 238. Arithmetic logicunit 230 always performs Boolean functions before arithmetic functionsin any mixed Boolean and arithmetic function. Thus a carry could rippleout of unmasked bits into one or more bits that were zeroed or set by aBoolean function. The following examples are useful in masking andconditional operations.

The function A+(B&C) can be expressed as A&(all "1's")+(B&C). ChoosingF1(B,C)=all "1's" (F1 code of Hex "AA") and F2(B,C)=B&C (F2 code of Hex"C0") gives A+(B&C). The bit-wise exclusive OR of HEX "AA" and Hex "C0"gives the arithmetic logic unit function code of Hex "6A" listed inTable 23. This function can strip off bits from unsigned numbers. Asshown below, this function can be combined with barrel rotator 235 andmask generator 234 in performing right shift and add operations. In thiscase C acts as a bit mask that zeros bits of B everywhere C is "0".Since mask generator 234 can generate a mask with right justified ones,selection of mask generator 234 via multiplexer Cmux 233 permits thisfunction to zero some of the most significant bits in B before adding toA. Another use of this function is conditional addition of B to A.Selection of expand circuit 238 via multiplexer Cmux 233 enables controlof whether B is added to A based upon bits in Mflags register 211.During multiple arithmetic, bits in Mflags register 211 can controlcorresponding sections of arithmetic logic unit 230.

The function A+(B|˜C) can be expressed as A&(all `1'S")+(B|˜C). ChoosingF1(B,C)=all "1's" (F1 code of Hex "AA") and F2(B,C)=B|˜C (F2 code of"CF") yields this expression. The bit-wise exclusive OR of Hex "AA" andHex "C0" obtains the function code of Hex "65" as listed in Table 23.

The function A-(B&C) can be expressed as A&(all "1's")+(-(B&-C)-1)+1.Choosing F1(B,C)=all "1's" (F1 code Hex "AA") and F2(B,C)=-(B&C)-1 (F2code Hex "3F") with a carry-in injection of "1" yields this expression.The bit-wise exclusive OR of Hex "AA" and Hex "3F" yields the functioncode Hex "95" as listed in Table 23. This function can strip off or maskbits in the B input by the C input before subtracting from A.

There are 16 possible functions where the subfunction F1(B,C)=0. Thesefunctions are commonly used with other hardware to perform negation,absolute value, bit masking, and/or sign extension of the B-input by theC-input. When subfunction F1(B,C)=0 then the arithmetic logic unitfunction is given by subfunction F2(B,C).

The function -(B&C) may be expressed as (A&"0")+(-(B&C)). Thisexpression can be formed by choosing F1(B,C)=0 (F1 code Hex "00") andF2(B,C)=-(B&C)-1 (F2 code Hex "3F") with a carry-in injection of "1".The exclusive OR of Hex "00" and Hex "3F" yields the function code Hex"3F" as shown in Table 23. This function masks bits in B by a mask C andthen negates the quantity. This function can be used as part of a shiftright and negate operation.

Several functions support masking both terms of the sum in the equationabove in a useful manner. The function (A&C)+(B&C) can be achieved bychoosing F1(B,C)=C (F1 code Hex "A0") and F2(B,C)=B&C (F2 code Hex"C0"). The exclusive OR of Hex "A0" and Hex "F0" yields the functioncode Hex "60" as shown in Table 23. This function will effectively zerothe corresponding bits of the A and B inputs where C is "0" beforeadding. It should be noted that the Boolean function is applied beforethe addition and that one or more carries can ripple into the bits thathave been zeroed. When using multiple arithmetic such carries do notcross the boundaries between the split sections of arithmetic logic unit230. A common use for this function is to sum multiple smallerquantities held in one register. The B-port receives a rotated versionof the number going to the A-port and the C-port provides a mask for thebits that overlap. Four 8 bit numbers can be summed into two 16 bitnumbers or two 16 bit numbers summed into one 32 bit number in a singleinstruction.

The similar function (A&C)-(B&C) is achieved by choosing F1(B,C)=C (F1code Hex A0") and F2(B,C)=-(B&C)-1 and injecting a carry-in of "1". Theexclusive OR of Hex "A0" and Hex "3F" yields the function code Hex "9F"as shown in Table 23. This function can produce negative sums with theC-port value acting as a mask of the A and B inputs.

The function (A&B)+B is achieved by choosing F1(B,C)=C (F1 code Hex"A0") and F2(B,C)=B (F2 code Hex "CC"). The exclusive OR of Hex "A0" andHex "CC" yields the function code Hex "6C". This function canconditionally double B based on whether A is all "1's" or all "0's".

FIG. 26 illustrates in block diagram form an alternative embodiment ofarithmetic logic unit 230. The arithmetic logic unit 230 of FIG. 26forms the equation:

    S=F3(A,B,C)+F4(A,B,C)

where: S is the arithmetic logic unit resultant; and F3(A,B,C) andF4(A,B,C) can be any of the 256 possible Boolean functions of A, B andC. Adder 495 forms the addition of this equation and includes an inputfor a least significant bit carry input from bit 0 carry-in generator246. Boolean function generator 496 forms the function F3(A,B,C) ascontrolled by input function signals. Boolean function generator 497similarly forms the function F4(A,B,C) as controlled by input functionsignals. Note that Boolean function generators 496 and 497 independentlyform selected Boolean combinations of A, B and C from a set of the 256possible Boolean combinations of three inputs. Note that it is clearfrom this construction that arithmetic logic unit 230 forms the Booleancombinations before forming the arithmetic combination. The circuit inFIG. 21 can be modified to achieve this result. The generate/killfunction illustrated in FIG. 21 employs a part of the logic tree used inthe propagate function. This consists of pass gates 451, 452, 453, 454,461 and 462. Providing a separate logic tree for this function thatduplicates pass gates 451, 452, 453, 454, 461 and 462 and eliminatingthe NOT A gate 475 results in a structure embodying FIG. 26. Note inthis construction one of the generate or kill terms may occursimultaneously with the propagate term. This construction provides evengreater flexibility than that illustrated in FIG. 25.

The three input arithmetic logic unit 230, the auxiliary data pathhardware and knowledge of the binary number system can be used to formmany useful elementary functions. The instruction set of the digitalimage/graphics processors makes more of the hardware accessible to theprogrammer than typical in microprocessors. Making hardware moreaccessible to the programmer exposes some aspects of architecture thatare hidden on most other processors. This instruction set supportsforming custom operations using the elemental functions as buildingblocks. This makes greater functionality accessible to the programmerbeyond the hardware functions commonly found within other processors,the digital image/graphics processors have hardware functions that canbe very useful for image, graphics, and other processing. Thiscombination of hardware capability and flexibility allows programmers toperform in one instruction what could require many instructions on mostother architectures. The following describes some key elementalfunctions and how two or more of them can be combined to produce a morecomplex operation.

The previous sections described the individual workings of eachfunctional block of data unit 110. This section will discuss how thesefunctions can be used in combination to perform more complex operations.Barrel rotator 235, mask generator 239 and 3-input arithmetic logic unit230 can work together to perform shift left, unsigned shift right, andsigned shift right either alone or combination with addition orsubtraction in a single arithmetic logic unit instruction cycle. Anassembler produces program code for digital image/graphics processors71, 72, 73 and 74. This assemblier preferably supports the symbols ">>u"for unsigned (logical) right shift, ">>" or ">>s" for arithmetic(signed) right shift, and "<<" for a left shift. These shift notationsare in effect macro functions that select the appropriate explicitfunctions in terms of rotates, mask generation, and arithmetic logicunit function. The assemblier also preferably supports explicitlyspecifying barrel rotation ("\\"), mask generation ("%" and "%!"), andthe arithmetic logic unit function. The explicit notation will generallybe used only when specifying a custom function not expressible by theshift notation.

Data unit 110 performs left shift operations in a single arithmeticlogic unit cycle. Such a left shift operation includes barrel rotatorvia barrel rotator 235 by the number of bits of the left shift. As notedabove during such rotation, bits that rotate out the left wrap aroundinto the right and thus need to be stripped off to perform a left shift.The rotated output is sent to the B-port of arithmetic logic unit 230.Mask generator 239 receives the shift amount and forms a mask with anumber of right justified ones equal to the shift amount. Note that thesame shift amount supplies the rotate control input of barrel rotator235 from second input bus 202 via multiplexer Smux 231 and maskgenerator 239 from second input bus 202 via multiplexer Mmux 234. Maskgenerator 239 supplies the C-port of arithmetic logic unit 230.Arithmetic logic unit 230 combines the rotated output with the mask withthe Boolean function B&˜C. Left shifts are expressed in the assemblierbelow:

    Left.sub.-- Shift=Input<<Shift.sub.-- Amount

This operation is equivalent to the explicit notation:

    Left.sub.-- Shift=(Input\\Shift.sub.-- Amount)&˜%Shift.sub.-- Amount

The following example shows of a left shift of Hex "53FFFFA7" by 4 bits.While shown in several steps, data unit 110 performs this in a singlepass arithmetic logic unit cycle The original number in binary notationis:

    0101 0011 1111 1111 1111 1111 1010 0111

Rotation by 4 places in barrel rotator 235 yields:

    0011 1111 1111 1111 1111 1010 0111 0101

Mask generator 239 forms the following mask:

    0000 0000 0000 0000 0000 0000 0000 1111

Arithmetic logic unit 230 forms the logical combination B&˜C. This masksbits in the rotated amount causing them to be "0" and retains the otherbits. This yields the left shift result:

    0011 1111 1111 1111 1111 1010 0111 0000

The left shift of the above example results in an arithmetic overflow,because some bits have "overflowed". During a shift left, arithmeticoverflow occurs for unsigned numbers if any bits are shifted out.Arithmetic overflow may also occur for signed numbers if the resultingsign bit differs from the original sign bit. Arithmetic logic unit 230of this invention does not automatically detect arithmetic overflow onleft shifts. Left shift overflow can be detected by subtracting theleft-most-bit-change amount of the original number generated byLMO/RMO/LMBC/RMBC circuit 237 from the left shift amount. If thedifference is less than or equal to zero, then no bits will overflowduring the shift. If the difference is greater than zero, thisdifference is the number of bits that overflow.

The assemblier further controls data unit 110 to perform left shift andadd operations and left shift and subtract operations. The assembliertranslates the A+(B<<n) function into control of barrel rotator 235,mask generator 239, and arithmetic logic unit 230 to performed thedesired operation. A shift left and add operation works identically tothe above example of a simple shift except for the operation ofarithmetic logic unit 230. Instead of performing the logical functionB&˜C as in a simple shift, the arithmetic logic unit performs the mixedarithmetic and logical function A+(B&˜C). A left shift and add operationis expressed in the assemblier notation as:

    LShift.sub.-- Add=Input1+Input2<<Shift.sub.-- Amount

This operation is equivalent to:

    LShift.sub.-- Add=Input1+[(Input2\\Shift.sub.-- Amount)&˜%Shift.sub.-- Amount]

The following example shows a left shift of Hex "53FFFFA7" by 4 bitsfollowed by addition of Hex "000000AA". Note that all these stepsrequire only a single arithmetic logic unit cycle. The original Input2in binary notation is:

    0101 0011 1111 1111 1111 1111 1010 0111

Rotation by 4 places in barrel rotator 235 yields:

    0011 1111 1111 1111 1111 1010 0111 0101

Mask generator 239 forms the mask:

    0000 0000 0000 0000 0000 0000 0000 1111

Arithmetic logic unit 230 forms the logical combination B&˜C producing aleft shift result:

    0011 1111 1111 1111 1111 1010 0111 0000

The other operand Input1 in binary notation is:

    0000 0000 0000 0000 0000 0000 1010 1010

Finally the sum is:

    0011 1111 1111 1111 1111 1011 0001 1010

Note that arithmetic logic unit 230 forms the logical combination andthe arithmetic combination in a single cycle and that the left shiftresult shown above is not available as an intermediate result. Note alsothat the sum may overflow even if the left shift does not produce anoverflow. Overflow of the sum is detected by generation of a carry-outfrom the most significant bit of arithmetic logic unit 230. Thiscondition is detected and stored in the "V" bit of status register 210.

The shift left and subtract operation also breaks down into a set offunctions performed by barrel rotator 235, mask generator 237, andarithmetic logic unit 239 in a single arithmetic logic unit cycle. Theleft shift and subtract operation differs from the previously describedleft shift operation and left shift and add operation only in thefunction of arithmetic logic unit 230. During left shift and subtractarithmetic logic unit 230 performs the mixed arithmetic and logicalfunction A+(B|˜C)+1. Arithmetic logic unit 230 performs the "+1"operation by injection of a "1" into the carry input of the leastsignificant bit. This injection of a carry-in takes place at bit 0carry-in generator 246. Most subtraction operations with this inventiontake place using such a carry-in of "1" to the least significant bit.The assemblier notation expresses left shift and subtract operations asfollows:

    LShift.sub.-- Sub=Input1-Input2<<Shift.sub.-- Amount

This operation is equivalent to:

    LShift.sub.-- Sub=Input1-[(Input2\\Shift.sub.-- Amount)&˜%Shift.sub.-- Amount]+1

The following example shows a left shift of Hex "53FFFFA7" by 4 bitsfollowed by subtraction of Hex "000000AA". Note that all these stepsrequire only a single arithmetic logic unit cycle. The original Input2in binary notation is:

    0101 0011 1111 1111 1111 1111 1010 0111

Rotation by 4 places in barrel rotator 235 yields:

    0011 1111 1111 1111 1111 1010 0111 0101

Mask generator 239 forms the mask:

    0000 0000 0000 0000 0000 0000 0000 1111

The result of the logical combination ˜B|C is as follows:

    1100 0000 0000 0000 0000 0101 1000 1111

The other operand Input1 in binary notation is:

    0000 0000 0000 0000 0000 0000 1010 1010

The sum A+(˜B|C) is:

    1100 0000 0000 0000 0000 0110 0011 1001

Finally the addition of the "1" injected into the least significant bitcarry-in yields:

    1100 0000 0000 0000 0000 0110 0011 1010

Note that arithmetic logic unit 230 forms the logical combination andthe arithmetic combination in a single cycle and that neither the leftshift result nor the partial sum shown above are available asintermediate results.

The assemblier of the preferred embodiment can control data unit 110 toperform an unsigned right shift with zeros shifted in from the left in asingle arithmetic logic unit cycle. Since barrel rotator 235 performs aleft rotate, at net right rotate may be formed with a rotate amount of32-n, where n is the number of bits to rotate right. Note, only the 5least significant bits of the data on second input bus 202 are used bybarrel rotator 235 and mask generator 239. Therefore the amounts 32 and0 are equivalent in terms of controlling the shift operation. Theassembler will automatically make the 32-n computation for shifts withan immediate right shift amount. The assemblier of the preferredembodiment requires the programmer form the quantity 32-n on registerbased shifts.

Once the accommodation for right rotation is made, the unsigned shiftright works the same as the shift left except that arithmetic logic unit230 performs a different function. This operation includes rotation bythe quantity 32-n via barrel rotator 235. The result of this net rotateright will to have bits wrapped around from the least significant to themost significant part of the word. The same quantity (32-n) controlsmask generator 239, which will generate 32-n right justified ones. Maskgenerator 239 is controlled with the "!" option so that a shift amountof zero produces a mask of all "1's". In this case no bits are to bestripped off. Arithmetic logic unit 230 then forms a Boolean combinationof the outputs of barrel rotator 235 and mask generator 239.

An example of an unsigned right shift operation is shown below. Theassemblier notation for an unsigned right shift is:

    Unsigned.sub.-- Right.sub.-- Shift=Input>>u(32-Shift.sub.-- Amount)

The equivalent operation explicitly showing the functions performed is:

    Unsigned.sub.-- Right.sub.-- Shift=(Input\\(32-Shift.sub.-- Amount))&%!(32-Shift.sub.-- Amount)

Note in the equation above the mask operator "%!" specifies that if theshift amount is zero, an all "1" mask will be generated. The examplebelow shows the unsigned shifting the number Hex "53FFFFA7" right by 4bit positions. The original number in binary form is:

    0101 0011 1111 1111 1111 1111 1010 0111

This number when left rotated by 32-4=28 places becomes:

    0111 0101 0011 1111 1111 1111 1111 1010

Mask generator 239 forms a mask from the input 32-4=28, which is:

    0000 1111 1111 1111 1111 1111 1111 1111

Lastly arithmetic logic unit 230 forms the Boolean combination B&Cyielding the result:

    0000 0101 0011 1111 1111 1111 1111 1010

Data unit 110 may perform either unsigned right shift and add orunsigned right shift and subtract operations. In the preferredembodiment the assemblier translates the notation A+B>>u(n) into aninstruction that controls barrel rotator 235, mask generator 239 andarithmetic logic unit 230 to performed an unsigned right shift and addoperation. The unsigned shift right and add works identically to theprevious example of a simple unsigned shift right except that arithmeticlogic unit 230 performs the function A+(B&C). In the preferredembodiment the assemblier translates the notation A-B>>u(n) into aninstruction that controls barrel rotator 235, mask generator 239 andarithmetic logic unit 230 to performed an unsigned right shift andsubtract operation. The unsigned shift right and subtract workssimilarly to the previous example of a simple unsigned shift rightexcept that arithmetic logic unit 230 performs the function A-(˜B|C)+1.As with left shift and subtract the "+1" operation involves injection ofa "1" carry-in into the least significant bit via bit 0 carry-ingenerator 246.

The assemblier of the preferred embodiment can control data unit 110 toperform a signed right shift with sign bits shifted in from the left ina single arithmetic logic unit cycle. The assembler will automaticallymake the 32-n computation for such shifts with an immediate right shiftamount. Data unit 110 includes hardware that detects that state of themost significant bit, called the sign bit, of the input into barrelrotator 235. This sign bit may control the 4 least significant bits ofthe function code. When using this hardware, the 4 least significantbits of the function code are inverted if the sign bit is "0". Signedright shift operations use this sign detection hardware to control thefunction arithmetic logic unit 230 performs based on the sign of theinput to barrel rotator 235. This operation can be explained using thefollowing elemental functions. Barrel rotator 235 performs a net rotateright by rotating left by 32 minus the number of bits of the desiredsigned right shift (32-n). This shift amount (32-n) is supplied to maskgenerator 237, which will thus generate 32-n right justified "1's". The"1's" of this mask will select the desired bits of the number that isright shifted. The "0's" of this mask will generate sign bits equal tothe of the most significant bit input to barrel rotator 235. Arithmeticlogic unit 230 then combines the rotated number from barrel rotator 235and the mask from mask generator 237. The Boolean function performed byarithmetic logic unit 230 depends upon the sign bit at the input tobarrel rotator 235. If this sign bit is "0", then arithmetic logic unit230 receives function signals to perform B&C. While selecting therotated number unchanged, this forces "0" any bits that are "0" in themask. Thus the most significant bits of the result are "0" indicatingthe same sign as the input to barrel rotator 235. If the sign bit is"1", then arithmetic logic unit 230 received function signal to performB|˜C. This function selects the rotated amount unchanged while forcingto "1" any bits that are "0" in the mask. The change in function codeinvolves inverting the 4 least significant bits if the detected sign bitis "0". Thus the most significant bits of the result are "1", the samesign indication as the input to barrel rotator 235.

Two examples of the unsigned right shift operation are shown below.Signed right shift is the default assemblier notation for right shifts.The two permitted assemblier notations for a signed right shift are:

    Signed.sub.-- Right.sub.-- Shift=Input>>s(32-Shift.sub.-- Amount)

    Signed.sub.-- Right.sub.-- Shift=Input>>(32-Shift.sub.-- Amount)

Because this operation uses the sign detection hardware, there is noexplicit way in the notation of the preferred embodiment of theassemblier to specify this operation in terms of rotation and masking.In the preferred embodiment the sign of the input to barrel rotator 235controls inversion of the function signals F3-F0. The first exampleshows a 4 place signed right shift of the negative number Hex"ECFFFFA7". The original number in binary notation is:

    1110 1100 1111 1111 1111 1111 1010 0111

Left rotation by 28 (32-4) places yields:

    0111 1110 1100 1111 1111 1111 1111 1010

Mask generator 237 forms this mask:

    0000 1111 1111 1111 1111 1111 1111 1111

Because the most significant bit of the input to barrel rotator 235 is"1", arithmetic logic unit 230 forms the Boolean combination of B|˜C.This yields the result:

    1111 1110 1100 1111 1111 1111 1111 1010

In this example "1's" are shifted into the most significant bits of theshifted result, matching the sign bit of the original number. The secondexample shows a 4 place signed right shift of the positive number Hex"5CFFFFA7". The original number in binary notation is:

    0101 1100 1111 1111 1111 1111 1010 0111

Left rotation by 28 (32-4) places yields:

    0111 0101 1100 1111 1111 1111 1111 1010

Mask generator 237 forms this mask:

    0000 1111 1111 1111 1111 1111 1111 1111

Because the most significant bit of the input to barrel rotator 235 is"0", arithmetic logic unit 230 forms the Boolean combination of B&C byinversion of the four least significant bits of the function code. Thisyields the result:

    0000 0101 1100 1111 1111 1111 1111 1010

Note that upon this right shift "0's" are shifted in the mostsignificant bits, matching the sign bit of the original number.

Data unit 110 may perform either signed right shift and add or signedright shift and subtract operations. In the preferred embodiment theassemblier translates the notations A+B>>(n) or A+B>>s(n) into aninstruction that controls barrel rotator 235, mask generator 239 andarithmetic logic unit 230 to perform a signed right shift and addoperation. The signed shift right and add works identically to theprevious example of the signed shift right except for the functionperformed by arithmetic logic unit 230. In the signed right shift andadd operation arithmetic logic unit 230 performs the function A+(B&C) ifthe sign bit of the input to barrel rotator 235 is "0". If this sign bitis "1", then arithmetic logic unit 230 performs the function A+(B|˜C).In the preferred embodiment the assemblier translates the notationsA-B>>s(n) or A-B>>(n) into an instruction that controls barrel shifter235, mask generator 239 and arithmetic logic unit 230 to perform asigned right shift and subtract operation. The signed shift right andsubtract operation works similarly to the previous example of a simplesigned shift right except for the function of arithmetic logic unit 230.When the sign bit is "1", arithmetic logic unit 230 performs thefunction A-(B&C)+1. When the sign bit is "0", arithmetic logic unit 230performs the alternate function A-(B|˜C)+1. As in the case of left shiftand subtract the "+1" operation involves injection of a "1" carry-ininto the least significant bit via bit 0 carry-in generator 246.

Barrel rotator 235, mask generator 237 and arithmetic logic unit 230 canperform field extraction in a single cycle. A field extraction takes afield of bits in a word starting at any arbitrary bit position, stripsoff the bits outside the field and right justifies the field. Such afield extraction is performed by rotating the word left the number ofbits necessary to right justify the field and masking the result of therotation by the number of bits in the size of the field. Unlike thecases for shifting, the rotation amount, which is based on the bitposition, and the mask input, which is based on the field size, are notnecessarily the same amount. The assemblier of the preferred embodimentemploys the following notation for field extraction:

    Field.sub.-- Extract=(Value\\(32-starting.sub.-- bit))&%!Field size

The "%!" operator causes mask generator 237 to form a mask having anumber of right justified "1's" equal to the field size, except for aninput of zero. In that case all bits of the generated mask are "1". sothat no bits are masked by the logical AND operation. This rotation andmasking may produce wrapped around bits if the field size is greaterthan the starting bit position. These parameters specify an anomalouscase in which the specified field extends beyond the end of the originalword. Data unit 110 provides no hardware check to for this case. It isthe responsibility of the programmer to prevent this result. The examplebelow demonstrates field extraction of a 4-bit field starting at bit 24,which is the eight bit from the left, of the number Hex "5CFFFFA7". Thenumber in binary form is:

    0101 1100 1111 1111 1111 1111 1010 0111

The number must be rotated left by 32-24 or 8 bits to right justify thefield. The output from barrel rotator 235 is:

    1111 1111 1111 1111 1010 0111 0101 1100

Mask generator 237 forms the following mask from the field size of 4bits:

    0000 0000 0000 0000 0000 0000 0000 1111

Lastly, arithmetic logic unit 230 forms the Boolean combination B&C.This produces the extracted field as follows:

    0000 0000 0000 0000 0000 0000 0000 1100

Mflags register 211 is useful in a variety of image and graphicsprocessing operations. These operations fall into two classes. The firstclass of Mflags operations require a single pass through arithmeticlogic unit 230. A number is loaded into Mflags register 211 and controlsthe operation of arithmetic logic unit 230 via expand circuit 238,multiplexer Cmux 233 and the C-port of arithmetic logic unit 230. Colorexpansion is an example of these single pass operations. The secondclass of Mflags operations require two passes through arithmetic logicunit 230. During a first pass certain bits are set within Mflagsregister 211 based upon the carry of zero results of arithmetic logicunit 230. During a second pass the contents of Mflags register 211control the operation of arithmetic logic unit 230 via expand circuit238, multiplexer Cmux 233 and the C-port of arithmetic logic unit 230.Such two pass Mflags operations are especially useful when usingmultiple arithmetic. Numerous match and compare, transparency, minimum,maximum and saturation operations fall into this second class.

A basic graphics operation is the conversion of one bit per pixel shapedescriptors into pixel size quantities. This is often called colorexpansion. In order to conserve memory space the shape of bit mappedtext fonts are often stored as shapes of one bit per pixel. These shapesare then "expanded" into the desired color(s) when drawn into thedisplay memory. Generally "1's" in the shape descriptor select a "onecolor" and "0's" in the shape descriptor select a "zero color". Acommonly used alternative has "0's" in the shape descriptor serving as aplace saver or transparent pixel.

The following example converts 4 bits of such shape descriptor data into8 bit pixels. In this example the data size of the multiple arithmeticoperation is 8 bits. Thus arithmetic logic unit 230 operates in 4independent 8 bit sections. The four bits of descriptor data "0110" areloaded into Mflags register 211:

    XXXXXXXX XXXXXXXX XXXXXXXX XXXX0110

The bits listed as "X" are don't care bits that are not involved in thecolor expansion operation. Expand circuit 238 expands these four bits inMflags register 211 into blocks of 8 bit "1's" and "0's" as follows:

    00000000 11111111 11111111 00000000

The one color is supplied to the A-port of arithmetic logic unit 230repeated for each of the 4 pixels within the 32 bit data word:

    11110000 11110000 11110000 11110000

The zero color is supplied to the B-port of arithmetic logic unit 230,also repeated for each of the 4 pixels:

    10101010 10101010 10101010 10101010

Arithmetic logic unit 230 forms the Boolean combination (A&C)|(B&˜C)which yields:

    10101010 11110000 11110000 10101010

Color expansion is commonly used with a PixBlt algorithm. To perform acomplete PixBlt, the data will have to be rotated and merged with priordata to align the bits in the data to be expanded with the pixelalignment of the destination words. Barrel rotator 235 and arithmeticlogic unit 230 can align words into Mflags register 211. This exampleassumed that the shape descriptor data was properly aligned to keep theexample simple. Note also that Mflags register 211 has its own rotationcapability upon setting bits and using bits. Thus a 32 bit word can beloaded into Mflags register 211 and the above instruction repeated 8times to generate 32 expanded pixels.

Simple color expansion as in the above example forces the result to beone of two solid colors. Often, particularly with kerned text letterswhose rectangular boxes can overlap, it is desirable to expand "1's" inthe shape descriptor to the one color but have "0's" serve as placesaver or transparent pixels. The destination pixel value is unchangedwhen moving such a transparent color. Data unit 110 can perform atransparent color expand by simply using a register containing theoriginal contents of the destination as the zero value input. An exampleof this appears below. Arithmetic logic unit 230 performs the samefunction as the previous color expansion example. The only difference isthe original destination becomes one of the inputs to arithmetic logicunit 230. The four bits of descriptor data "0110" are loaded into Mflagsregister 211:

    XXXXXXXX XXXXXXXX XXXXXXX XXXX0110

Expand circuit 238 expands these four bits in Mflags register 211 intoblocks of 8 bit "1's" and "0's" as follows:

    00000000 11111111 11111111 00000000

The one color is supplied to the A-port of arithmetic logic unit 230repeated for each of the 4 pixels within the 32 bit data word:

    11110000 11110000 11110000 11110000

The original destination data is supplied to the B-port of arithmeticlogic unit 230, original destination data including 4 pixels:

    11001100 10101010 11101110 11111111

Arithmetic logic unit 230 again forms the Boolean combination(A&C)|(B&˜C) which yields:

    11001100 11110000 11110000 11111111

Note that the result includes the one color for pixels corresponding toa "1" in Mflags register 211 and the original pixel value for pixelscorresponding to a "0" in Mflags register 211.

Data unit 110 can generate a 1 bit per pixel mask based on an exactmatch of a series of 8 bit quantities to a fixed compare value. This isshown in the example below. The compare value is repeated four timeswithin the 32 bit word. Arithmetic logic unit 230 subtracts the repeatedcompare value from a data word having four of the 8 bit quantities.During this subtraction, arithmetic logic unit 230 is split into 4sections of 8 bits each. The zero detectors 321, 322, 323 and 324illustrated in FIG. 7 supply are data to be stored in Mflags register211. This example includes two instructions in a row to demonstrateaccumulating by rotating Mflags register 211. Initially Mflags register211 stores don't care data:

    XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX

The first quantity for comparison is:

    00000011 00001111 00000001 00000011

The compare value is "00000011". This is repeated four times in the 32bit word as:

    00000011 00000011 00000011 00000011

Arithmetic logic unit 230 subtracts the compare value from the firstquantity. The resulting difference is:

    00000000 00001100 11111110 00000000

This forms the following zero compares "1001" that are stored in Mflagsregister 211. In this example Mflags register 211 is pre-cleared beforestoring the zero results. Thus Mflags register 211 is:

    00000000 00000000 00000000 00001001

The second quantity for comparison is:

    00000111 11111100 00000011 00000000

The result of a second subtraction of the same compare value is:

    00000100 11111001 00000000 11111101

This forms the new zero compares "0010" that are stored in Mflagsregister 211 following rotation of four places:

    00000000 00000000 00000000 10010010

Additional compares may be made in the same fashion until Mflagsregister 211 stores 32 bits. Then the contents of Mflags register 211may be moved to another register or written to memory.

Threshold detection involves comparing pixel values to a fixedthreshold. Threshold detection sets a 1 bit value for each pixel whichsignifies the pixel value was greater than or less than the fixedthreshold. Depending on the particular application, the equal to case isgrouped with either the greater than case or the less than case. Dataunit 110 may be programmed to from the comparison result in a singlearithmetic logic unit cycle. Arithmetic logic unit 230 forms thedifference between the quantity to be tested and the fixed threshold.The carry-outs from each section of arithmetic logic unit 230 are savedin Mflags register 211. If the quantity to be tested I has the fixedthreshold T subtracted from it, a carry out will occur only if I isgreater than or equal to T. As stated above, arithmetic logic unit 230performs subtraction by two's complement addition and under thesecircumstances a carry-out indicates a not-borrow. Below is an example ofthis process for four 8 bit quantities in which the threshold value is"00000111". Let four 8 bit quantities I to be tested be:

    00001100 00000001 00000110 00000111

The threshold value T repeated four times within the 32 bit word is:

    00000111 00000111 00000111 00000111

The difference is:

    00000101 11111010 11111111 00000000

which produces the following carry-outs "1001". This results in a Mflagsregister 211 of:

    XXXXXXXX XXXXXXXX XXXXXXXX XXXX1001

As in the case of match detection, this single instruction can berepeated for new data with Mflags resister rotation until 32 bits areformed.

When adding two unsigned numbers, a carry-out indicates that the resultis greater than can be expressed in the number of bits of the result.This carry-out represents the most significant bit of precision of theresult. Thus saving the carry-outs in Mflags register 211 can be used tomaintain precision. These carry-out bits may be saved for later additionto maintain precision. Particularly when used with multiple arithmetic,limiting the precision to fewer bits often enables the same process tobe performed in fewer arithmetic logic unit cycles.

Mflags operations of the second type employ both setting bits withinMflags register 211 and employing bits stored in Mflags register 211 tocontrol the operation of arithmetic logic unit 230. Multiple arithmeticcan be used it in combination with expands of Mflags register 211 toperform multiple parallel byte or half-word operations. Additionally,the setting of bits in Mflags register 211 and expanding Mflags register211 to arithmetic logic unit 230 are inverse space conversions that canbe used in a multitude of different ways.

The example below shows a combination of an 8 bit multiple arithmeticinstruction followed by an instruction using expansion to perform atransparency function. Transparency is commonly used when performingrectangular PixBlts of shapes that are not rectangular. The transparentpixels are used as place saver pixels that will not affect thedestination and thus are transparent so the original destination showsthrough. With transparency, only the pixels in the source that are notequal to the transparent code are replaced in the destination. In afirst instruction the transparent color code is subtracted from thesource and Mflags register 211 is set based on equal zero. If a given 8bit quantity matches the transparent code, a corresponding "1" will beset in Mflags register 211. The second instruction uses expansioncircuit 238 to expand Mflags register 211 to control selection on apixel by pixel basis of the source or destination. Arithmetic logic unit230 performs the function (A&C)|(B&˜C) to make this selection. Whilethis Boolean function is performed bit by bit, Mflags register 211 hasbeen expanded to the pixel size of 8 and thus it selects between pixels.The pixel source is:

    00000011 01110011 00000011 00000001

The transparent code TC is "00000011". Repeated 4 times to fill the 32bit word this becomes:

    00000011 00000011 00000011 00000011

The difference SRC-TC is:

    00000000 01110000 00000000 11111110

which produces the zero detection bits "1010". Thus Mflags register 211stores:

    XXXXXXXX XXXXXXXX XXXXXXXX XXXX1010

In the second instruction, expand circuit 238 expands Mflags register211 to:

    11111111 00000000 11111111 00000000

The original destination DEST is:

    11110001 00110011 01110111 11111111

The original source SRC forms a third input to arithmetic logic unit230. Arithmetic logic unit 230 then forms the Boolean combination(DEST&@MF)|(SRC&˜@MF) which is:

    11110001 00010011 01110111 00000001

Note that the resultant has the state of the source where the source wasnot transparent, otherwise it has the state of the destination. This isthe transparency function.

Data unit 110 can perform maximum and minimum functions using Mflagsregister 211 and two arithmetic logic unit cycles. The maximum functiontakes the greater of two unsigned pixel values as the result. Theminimum function takes the lesser of two unsigned pixel values as theresult. In these operations the first instruction performs multiplesubtractions, setting Mflags register 211 based on carry-outs. Thus forstatus setting arithmetic logic unit 230 forms OP1-OP2. This firstinstruction only sets Mflags register 211 and the resulting differenceis discarded. When performing the maximum function the secondinstruction, arithmetic logic unit 230 performs the operation(OP1&@MF)|(OP2&˜@MF). This forms the maximum of the individual pixels.Let the first operand OP1 be:

    00000001 11111110 00000011 00000100

and the second operand OP2 be:

    00000011 00000111 00000111 00000011

The difference OP1-OP2 is:

    11111110 11110111 11111100 00000000

This produces carry-outs (not-borrows) "0101" setting Mflags register211 as:

    XXXXXXXX XXXXXXXX XXXXXXXX XXXX0101

In the second instruction the four least significant bits in Mflagsregister 211 are expanded via expand circuit 238 producing:

    00000000 11111111 00000000 11111111

Arithmetic logic unit 230 performs the Boolean function(OP1&@MF)|(OP2&˜@MF). This produces the result:

    00000011 11111110 00000111 00000100

Note that each 8 bit section of the result has the state of the greaterof the corresponding sections of OP1 and OP2. This is the maximumfunction. The minimum function operates similarly to the maximumfunction above except that in the second instruction arithmetic logicunit 230 performs the Boolean function (OP1&˜@MF)|(OP2&@MF). ThisBoolean function selects the lesser quantity rather than greaterquantity for each 8 bit section.

Data unit 110 may also perform an add-with-saturate function. Theadd-with-saturate function operates like a normal add unless an overflowoccurs. In that event the add-with-saturate function clamps the resultto all "1's". The add-with-saturate function is commonly used ingraphics and image processing to keep small integer results fromoverflowing the highest number back to a low number. The example belowshows forming the add-with-saturate function using multiple arithmeticon four 8 bit pixels in two instructions. First the addition takes placewith the carry-outs stored in Mflags register 211. A carry-out of "1"indicates an overflow, thus that sum should be set to all "1's", whichis the saturated value. Then expand circuit 238 expands Mflags register211 to control selection of the sum or the saturated value. The firstoperand OP1 is:

    00000001 11111001 00000011 00111111

The second operand OP2 is:

    11111111 00001011 00000111 01111111

Arithmetic logic unit 230 forms the sum OP1+OP2=RESULT resulting in:

    00000000 00000100 00001010 10111110

with corresponding carry-outs of "1100". These are stored in Mflagsregister 211 as:

    XXXXXXXX XXXXXXXX XXXXXXXX XXXX1100

In the second instruction expand circuit 238 expands the four leastsignificant bits of Mflags register 211 to:

    11111111 11111111 00000000 00000000

Arithmetic logic unit 230 performs the Boolean function RESULT|@MFforming:

    11111111 11111111 00001010 10111110

Note the result of the second instruction equals the sum when the sumdid not overflow and equals "11111111" when the sum overflowed.

Data unit 110 can similarly perform a subtract-with-saturate function.The subtract-with-saturate function operates like a normal subtractunless an underflow occurs. In that event the subtract-with-saturatefunction clamps the result to all "0's". The subtract-with-saturatefunction may also be commonly used in graphics and image processing. Thedata unit 110 performs the subtract-with-saturate function similarly tothe add-with-saturate function shown above. First the subtraction takesplace with the carry-outs stored in Mflags register 211. A carry-out of"0" indicates a borrow and thus an underflow. In that event thedifference should be set to all "0's", which is the saturated value.Then expand circuit 238 expands Mflags register 211 to control selectionof the difference or the saturated value. During this second instructionarithmetic logic unit 230 performs the Boolean function RESULT&@CMF.This forces the combination to "0" if the corresponding carry-out was"0", thereby saturating the difference at all "0's". On the other handif the corresponding carry-out was "1", then the Boolean combination isthe same as RESULT.

FIG. 27 illustrates in block diagram form the construction of addressunit 120 of digital image/graphics processor 71 according to thepreferred embodiment of this invention. The address unit 120 includes: aglobal address unit 610; a local address unit 620; a global/localmultiplexer control register GLMUX 631; a pair of zero detectors 631 and632; a multiplexer 641; four control circuits 642, 643, 653, 654; aglobal temporary address register GTA 651; a local temporary addressregister LTA 652; a pair of address unit arithmetic buffers 655 and 656;an instruction decode logic 660; a global address port 121; and a localaddress port 122. As illustrated in FIG. 27, global/local addressmultiplexer register GLMUX 630 is coupled to global port source data busGsrc 105 and to global port destination data bus Gdst 107. Global/localaddress multiplexer register GLMUX 630 is in the register space ofdigital image/graphics processor 71 and may be written to or read fromas any other register. Global temporary address register GTA 651 isconnected to global port source data bus Gsrc 105 only. Though globaltemporary address register GTA is within the register space of digitalimage/graphics processor 71, the preferred embodiment allows reads frombut not writes to this register. An attempted write to global temporaryaddress register GTA 651 is ignored. Note that local temporary addressregister LTA 652 is coupled to neither global port source data bus Gsrc105 nor global port destination data bus Gdst 107. This register is notwithin the register space of digital image/graphics processor 71 andcannot be accessed. As previously described each digital image/graphicsprocessor 71, 72, 73 and 74 includes both a global data port and a localdata port, which may operate simultaneously. Separate global and localaddress units allow generation of independent addresses for theseindependent data transfers. In addition, some combined addresses arepermitted as will be further described below. Note that all thefunctions of address unit 120 are controlled by instruction decode logic660, which is responsive to the instruction currently in the addresspipeline stage via opcode bus 133. The details of these control linesare omitted from FIG. 27 for the sake of clarity. However, these controlfunctions are within the capability of one skilled in the art from thisdescription and the description of the instruction word formats inconjunction with FIG. 43.

Tables 25 and 26 detail the permitted addresses generated by therespective global and local data ports of digital image/graphicsprocessors 71, 72, 73 and 74. Table 25 indicates the permitted dataspace addresses in hexadecimal according to the form Hex "0000????",where the range of the final four digits "????" is shown in Table 25.

                  TABLE 25                                                        ______________________________________                                        Global  Local Ports                                                           Ports   DIGP 71   DIGP 72   DIGP 73 DIGP 74                                   ______________________________________                                        0000-3FFF                                                                             0000-0FFF 1000-1FFF 2000-2FFF                                                                             3000-3FFF                                   8000-8FFF 8000-87FF 9000-97FF A000-A7FF B000-B7FF                             9000-97FF                                                                     A000-A7FF                                                                     B000-B7FF                                                                   ______________________________________                                    

In a similar fashion, Table 26 indicates the permitted parameter spaceaddresses in hexadecimal according to the form Hex "0100????", where therange of the final four digits "????" is shown in Table 26.

                  TABLE 26                                                        ______________________________________                                        Global  Local Ports                                                           Ports   DIGP 71   DIGP 72   DIGP 73 DIGP 74                                   ______________________________________                                        0000-07FF                                                                             0000-07FF 1000-17FF 2000-27FF                                                                             3000-37FF                                   1000-17FF                                                                     2000-27FF                                                                     3000-37FF                                                                   ______________________________________                                    

Tables 25 and 26 show the limitations on addressing of the local dataports. As previously described, the global data ports (G) of the fourdigital image/graphics processors 71, 72, 73 and 74 may address anylocation within a data memory or a parameter memory. At the same timethe local data ports (L) of each digital image/graphics processor 71,72, 73 and 74 may only address the data and parameter memoriescorresponding to that digital image/graphics processor.

FIG. 28 illustrates in block diagram form the construction of globaladdress unit 610. In accordance with the preferred embodiment, localaddress unit 620 is constructed identically. Global address unit 610includes: a set of address registers 611; a set of index registers 612;multiplexers 613 and 616; an index scaler circuit 614; and anaddition/subtraction unit 615. According to the preferred embodiment theaddresses include 32 bits, therefore address registers 611 and indexregisters 612 store data words of 32 bits and addition/subtraction unit615 operates on data words of 32 bits.

Table 27 lists the address register assignments. Note that addressregisters 611 are coupled to both global port source data bus Gsrc 105and global port destination data bus Gdst 107. These connections allowregister loads from memory, register stores to memory, and register toregister data transfer with other registers within that digitalimage/graphics processor, such as data registers 200 within data unit110. Various uses of these connections will be described below.

                  TABLE 27                                                        ______________________________________                                        Address                                                                         Register Register Assignment                                                ______________________________________                                        A0              Local address unit                                              A1 Local address unit                                                         A2 Local address unit                                                         A3 Local address unit                                                         A4 Local address unit                                                         A5 reserved                                                                   A6 Global/Local address units                                                  shared stack pointer                                                         A7 Local address unit                                                          read only, all zeros                                                         A8 Global address unit                                                        A9 Global address unit                                                        A10 Global address unit                                                       A11 Global address unit                                                       A12 Global address unit                                                       A13 reserved                                                                  A14 Global/Local address units                                                 shared stack pointer                                                         A15 Global address unit                                                        read only, all zeros                                                       ______________________________________                                    

Address registers A0, A1, A2, A3 and A4 are within local address unit620 and are available for general use. Address register A5 is notsupported in the current embodiment, but its address is reserved forfuture expansion of the local address unit 620. Address registers A8,A9, A10, A11 and A12 are within global address unit 620 and areavailable for general use. Address register A13 is not supported in thecurrent embodiment, but its address is reserved for future expansion ofthe global address unit 610. Address registers A6 and A14 are embodiedby a single register accessible by local address unit 620 at address A6and by address unit 610 at address A14. This combined register A14/A6will generally be used as a stack pointer. Note that stack operationsare only allowed on aligned 32 bit word boundaries. Consequently the twoleast significant bits of combined register A14/A6 are hardwired to"00". Writing to these two bits has no effect and they are always readas "00". Registers A7 and A15 are also embodied by the same hardware andboth global address sun-unit 610 and local address unit 620 may use thiscombined register in the same instruction. Register A7 is accessible tolocal address unit 620 and register A15 is accessible to global addressunit 610. Combined register A15/A7 is hardwired to all "0's". Writing toeither of these two registers has no effect and they are always read asall "0's". In the preferred embodiment these two registers are embodiedby the same hardware accessible at differing addresses.

Table 28 lists the index register assignments. Index registers 612 arecoupled to both global port source data bus Gsrc 105 and global portdestination data bus Gdst 107. These connections permits register loadsfrom memory, register stores to memory, and register to register datatransfer with other registers within that digital image/graphicsprocessor, such as data registers 200 within data unit 110. Various usesof these connections will be described below.

                  TABLE 28                                                        ______________________________________                                        Index                                                                           Register Register Assignment                                                ______________________________________                                        X0                Local address unit                                            X1 Local address unit                                                         X2 Local address unit                                                         X3 reserved                                                                   X4 reserved                                                                   X5 reserved                                                                   X6 reserved                                                                   X7 reserved                                                                   X8 Global address unit                                                        X9 Global address unit                                                        X10 Global address unit                                                       X11 reserved                                                                  X12 reserved                                                                  X13 reserved                                                                  X14 reserved                                                                  X15 reserved                                                                ______________________________________                                    

Index registers X0, X1 and X2 are within local address unit 620 and areavailable for general use. Index registers X3, X4, X5, X6 and X7 are notsupported in the current embodiment, but their addresses are reservedfor future expansion of the local address unit 620. Index registers X8,X9 and X10 are within global address unit 620 and are available forgeneral use. Index registers X11, X12, X13, X14 and X15 are notsupported in the current embodiment, but their addresses are reservedfor future expansion of the global address unit 610.

Global address unit 610 generates a 32 bit address. Either an indexstored in a specified index register within index registers 612 or anoffset field from the instruction word is selected at multiplexer 613.This selection is controlled by the instruction via instruction decodelogic 660 (FIG. 27). Multiplexer 613 also selects the size of the offsetfield again based on the instruction. As will be further discussedbelow, global address unit 610 may receive a 15 bit offset field or a 3bit offset field. Whether the offset field is 15 bits or 3 bits, thisvalue is zero extended to 32 bits before use.

Index scaler 614 optionally left shifts the data selected by multiplexer613. This optional left shift is selected by a scaled/unscaled inputthat corresponds to the function of the instruction. This left shift is0, 1 or 2 bits depending on the indicated data size. As previouslydescribed the pixel data may be specified as 8 bits (byte), 16 bits(half word) or 32 bits (word). If scaling is selected, then the data isleft shifted with zero filling 0 bit places for byte data, 1 bit placefor half word data and 2 bit places for word data. Since no scaling everoccurs for byte data transfers, the instruction word bit specifyingscaling is available for other purposes. In the preferred embodimentthis instruction word bit is used as an additional offset bit. Thus ifthe data size is 8 bits, the instruction can supply a 16 bit offsetindex rather than a 15 bit offset index or a 4 bit offset index ratherthan a 3 bit offset index. This address index scaling feature permitsaddressing that is independent from the data size. This feature isuseful in certain applications such as look up table operations.

Addition/subtraction unit 615 receives a base address from an addressregister selected by the instruction and the index. The instructionselects either addition of the index to the base address or subtractionof the index from the base address. The resultant forms one input tomultiplexer 616. The base address from the selected address registerforms the other input to multiplexer 616. Multiplexer 616 selects one ofthese addresses depending on whether the instruction specifiespre-indexing or post-indexing. If the instruction specifiespre-indexing, then the resultant of addition/subtraction unit 615 isselected by multiplexer 616 as the output address. If the instructionspecified post-indexing, then the base address from address registers611 is selected by multiplexer 616 as the output address.

The modified address may be written into the selected address register.In pre-indexing, then instruction selects whether to write the modifiedaddress into the source address register within address registers 611.In post-indexing, then the modified address is always written into thesource address register within address registers 611. In the preferredembodiment, the instruction word specifies one of 12 modes for each ofthe global address unit 610 and the local address unit 620. These twelvemodes include: pre-addition of an offset index without base addressmodification; pre-addition of an offset index with base addressmodification; post-addition of an offset index with base addressmodification; pre-subtraction of an offset index without base addressmodification; pre-subtraction of an offset index with base addressmodification; post-subtraction of an offset index with base addressmodification; pre-addition from an index register without base addressmodification; pre-addition from an index register with base addressmodification; post-addition from an index register with base addressmodification; pre-subtraction from an index register without baseaddress modification; pre-subtraction from an index register with baseaddress modification; and post-subtraction from an index register withbase address modification.

Special read only zero value address registers A15/A7 permit specialfunctions. Specification of the corresponding one of these registers asthe source of the base address converts the index address into anabsolute address. Specification of one of these zero value addressregisters may also load an offset index.

Hardware associated with each address unit permits specification of thebase address of the data memories and the parameter memory correspondingto each digital image/graphics processor. This specification occursemploying two pseudo address registers. Specification of "PBA" as theaddress register produces the address of the parameter memorycorresponding to that digital image/graphics processor. The parametermemory base address register of each digital image/graphics processorpermanently stores the base address of the corresponding parametermemory. The parameter memory 25 corresponds to digital image/graphicsprocessor 71, parameter memory 30 corresponds to digital image/graphicsprocessor 72, parameter memory 35 corresponds to digital image/graphicsprocessor 73, and parameter memory 40 corresponds to digitalimage/graphics processor 74. Specification of "DBA" as the addressregister produces the address of the base data memory corresponding tothat digital image/graphics processor. The data memory 22 includes thelowest address corresponding to digital image/graphics processor 71,data memory 27 includes the lowest address corresponding to digitalimage/graphics processor 72, data memory 32 includes the lowest addresscorresponding to digital image/graphics processor 73 and data memory 37includes the lowest address corresponding to digital image/graphicsprocessor 74.

These pseudo address registers may be used in global address unit 610and local address unit 620 and with indices in any of the 12 permittedcombinations of pre- and post-addition or subtraction, except that thesemay not be address destinations. There are restrictions on the permitteddata transfers when using these pseudo address registers. These arecalled pseudo address registers because no actual address registercorresponds to these designations. Instead each address unit employshardware in conjunction with an identifier in a command register (to belater described) to produce the required address.

The particular addresses for the preferred embodiment of this inventionare listed below in Table 29. The pseudo address register PBA producesan address of the form Hex "0100#000" and the pseudo address registerDBA produces an address of the form Hex "0000#000", where # is thedigital image/graphics processor number.

                  TABLE 29                                                        ______________________________________                                        Digital                                                                         Image/ Parameter Data                                                         Graphics Memory Memory                                                        Processor Base Base                                                           Number Address Address                                                      ______________________________________                                        0              01000000 00000000                                                1 01001000 00001000                                                           2 01002000 00002000                                                           3 01003000 00003000                                                         ______________________________________                                    

These pseudo address registers are advantageously used in programswritten independent of the particular digital image/graphics processor.These pseudo address registers allow program specification of addressesthat correspond to the particular digital image/graphics processor. Thusprograms may be written which are independent of the particular digitalimage/graphics processor executing the programs.

Referring back to FIG. 27, address unit 120 forms respective addresseson global address port 121 and local address port 122. In the leastcomplex case, the global address generated by global address unit 610passes through multiplexer 641 and is stored in global temporary addressregister GTA 651. Global address port 121 passes this address togetherwith byte strobe, read/write and select signals to crossbar 50.Similarly the local address generated by local address unit 620 isstored in local temporary address register LTA 652 for supply tocrossbar 50 via local address port 122 together with accompanying bytestrobe, read/write and select signals. Global temporary address register651 and local temporary address register 652 hold the generatedaddresses for reuse in case of crossbar contention. This is moreconvenient than recomputing the address for reuse because thepossibility of address register modification would require conditionalrecomputation.

Sometimes an address generated by local address unit 620 passes tocrossbar 50 via global address port 121 rather than by local addressport 122. Control circuit 654 determines if the address generated bylocal address unit 620 is a legal local address. Note that the localports may only address the corresponding data or parameter memory. Iflocal address unit 620 generates an address outside its permitted range,and no global port access is specified, then control circuit 654 signalscontrol circuit 642 to cause multiplexer 641 to select the local addressgenerated by local address unit 620. This address is then stored inglobal temporary address register GTA 651. If a global port access isspecified, this is serviced first and then control circuit 654 signalscontrol circuit 642 to cause multiplexer 641 to select the addressstored in local temporary address register LTA 652. In either caseglobal temporary address register GTA 653 supplies the address to theglobal address port 121.

Global/local address multiplexer register GLMUX 630 permits a singleaddress to be formed from parts of the addresses generated by globaladdress unit 610 and local address unit 620. This is known as XYpatching that forms a patched address. Global/local address multiplexerregister GLMUX 630 is coupled to both global port source data bus Gsrc105 and global port destination data bus Gdst 107 and can be accessedwithin the register space of digital image/graphics processor 71.Global/local address multiplexer register GLMUx 630 includes 30 bits.For each bit position of global/local address multiplexer register GLMUX630 a "1" selects the corresponding bit from global address unit 610 anda "0" selects the corresponding bit from local address unit 620.Global/local address multiplexer register GLMUX 630 signals controlcircuit 642 to make the corresponding bit selections within multiplexer641. The patched address from multiplexer 641 is stored in globaltemporary address register GTA 651 for application to global addressport 121 in the manner previously described.

In the preferred embodiment XY patched addressing only supportspost-indexing due to speed considerations. Note that XY patch addressselection must occur following address generation by both global addressunit 610 and local address unit 620. Thus XY patch address selectiontakes more time than normal addressing. Limiting XY patch addressing topost-indexing insures that this address is available not later thanother addresses. Note that if the timing of this address generation isnot an problem, then XY patch addressing may support all the addressmodes listed in Tables 45 and 47.

When executing an instruction calling for global/local addressmultiplexing, the instruction can specify XY patch detection. XY patchdetection determines when the address specified by the global or localaddress unit is outside a defined boundary or patch. A one bit patchoption field in the instruction word (bit 34) enables XY patchdetection. If this patch option field is "1", then specified operationsare performed when the generated address is outside the XY patch. Ifthis patch option field is "0", then these specified operations areperformed if the generated address is inside the XY patch. Zerodetectors 631 and 632 perform the patch detection. Zero detector 631masks the global port address generated by global address unit 610 withthe contents of global/local address multiplexer register 630. If thismasked address is non-zero, then the global address from global addressunit 610 includes a "1" in a data position assigned to local addressunit 620. This indicates the global address is outside the patch.Similarly zero detector 633 masks the local port address generated bylocal address unit 620 with the inverse of the contents of global/localaddress multiplexer register GLMUX 630. If this masked address isnon-zero, then the local address is outside the patch. The logical OR ofthese two outputs indicates whether the patched address is inside oroutside the patch.

The instruction word specifies alternative actions to be taken basedupon whether the patched address is inside or outside the patch. Aconditional access one bit field specifies conditional memory access. Ifthis conditional access field is "1", then memory access isunconditional and is performed whether the address is inside or outsidethe XY patch. If the conditional access field is "0", then the memoryaccess, either a load or a store, is conditional based upon the state ofthe patch option field. An interrupt one bit field indicates whether toissue an interrupt upon patch detection. When the interrupt field is"1", address unit 120 issues an interrupt upon patch detection in thesense specified by the patch option field. When the interrupt field is"0", no interrupt issues regardless of patch detection.

These XY patched address modes have several uses. A display screen canbe addressed in rows and columns by segregating the address betweenglobal address unit 610 and local address unit 620. Thus the name XYpatch addressing. The conditional memory accessing or interruptgeneration can then signal branch operations for window clipping. It isalso feasible to use this addressing mode in software "pseudo" datacaching to detect cache hit or cache miss.

Control circuits 653 and 654 control interface between data unit 120 andcrossbar 50. Each unit generates byte strobe signals, a read/writesignal and select signals. These signals control the data transferoperation. In addition each control circuit 653 and 654 receives fromcrossbar 50 a grant signal. Receipt of this grant signal indicates thatthe contention circuits of crossbar 50 have granted access to thecorresponding port. This could be either because there is no contentionfor memory access or any memory access contention has been resolved bygranting access to the corresponding port. Upon retry after an accessfailure due to memory contention, these signals are reconstituted fromthe instruction word stored in the instruction register-address stageIRA 751 and the generated address stored in either global temporaryaddress register GTA 651 or local temporary address register LTA 652.

The byte strobe signals handle the cases for writing data less than 32bits wide. The data size for data transfers of byte (8 bits), half-word(16 bits) or word (32 bits) is set by the instruction. If the data sizeis 8 bits, then the data is replicated 4 times to fill a 32 bit word.Similarly if the data size is 16 bits, this data is duplicated to fill32 bits. There are four byte strobe signals corresponding to the fourbytes in the 32 bit data word. Each of these four byte strobes may beactive ("1") indicating write that byte or inactive ("0") indicating donot write that byte. The byte strobes are set according to the 2 leastsignificant bits (bits 1-0) of the generated address and the currentendian mode.

The endian mode indicates the byte order employed in multi-byte data.FIG. 29a illustrates the byte order within a 32 bit data word accordingto the little endian mode. In the little endian mode the leastsignificant byte has a byte address of "0" and the most significant bytehas a byte address of "3". FIG. 29b illustrates the byte order within a32 bit data word according to the big endian mode. In the big endianmode the most significant byte has a byte address of "0" and the leastsignificant byte has a byte address of "3". Master processor 60 sets theendian mode, which is not expected to change dynamically. Note that thebit order within bytes does not change based upon the endian mode. Theconvention for bit order within bytes would generally be set by theconnections between the external data bus of transfer controller 80 andthe host data bus. Table 30 lists the byte strobes for the variouscombinations of address bits 1-0, data size and the endian mode.

                  TABLE 30                                                        ______________________________________                                        Address  Little Endian  Big Endian                                              bits Data size in bits Data size in bits                                    1 0      8      16       32   8      16   32                                  ______________________________________                                        0 0      0001   0011     1111 1000   1100 1111                                  0 1 0010 0011 1111 0100 1100 1111                                             1 0 0100 1100 1111 0010 0011 1111                                             1 1 1000 1100 1111 0001 0011 1111                                           ______________________________________                                    

As indicated in Table 30, if the two least significant address bits are"00", and the data size is 8 bits, then the last byte strobe for bits7-0 is active in the little endian mode and the first byte strobe forbits 31-24 is active in the big endian mode. When the data size is lessthan 32 bits, a write cycle is accomplished by a read-modify-writeoperation. The byte strobes determine the bytes modified by the data tobe written into memory. As previously described, it is technicallyfeasible to support data sizes of 4 bits, 2 bits and 1 bit besides thedata sizes noted above. Those skilled in the art would understand how toextend the byte strobe concept explained above to support these otherdata sizes.

Each control circuit 653 and 654 generates a read/write signal. Theread/write signal indicates that the memory access is a memory read ormemory write operation. A singe bit field in the instruction field foreach active port indicates whether the data transfer is a loadoperation, which is a memory read, or a store operation, which is amemory write. Control circuits 653 and 654 generate the correspondingread/write signal to crossbar 50 based upon the corresponding single bitfield in the instruction word.

Each control circuit 653 and 654 generates two strobe signals. An activedata-space select signal indicates that the memory transfer is to datamemory. An active parameter-space select signal indicates that thememory transfer is to parameter memory. Neither select signal is activeduring execution of an instruction not specifying a data transferoperation via that port. Bit 24 of the generated address controls theseselect signals due to the address partitioning. The data-space selectsignal is active when bit 24 of the address is "0" and theparameter-space select signal is active when bit 24 of the address is"1".

Global address unit 610 and local address unit 620 may be used foradditional arithmetic operations. The use of an address unit forarithmetic operations is called address unit arithmetic. An address unitarithmetic operation may be substituted for any memory load operation.Any instruction word with specifies data transfer operations includes abit that specifies whether the data transfer is a load (data transferfrom memory to a register) or a store (data transfer from a register tomemory). These instruction words also include a bit that specifieswhether the data is sign extended on load. Sign extension fills thehigher order bits of the data written to the destination with the samestate as the most significant bit of the data in case the data size isless than 32 bits. The otherwise meaningless combination of store withsign extend enables address unit arithmetic. Rather than fetching thememory data located at the address generated by the address unit andstoring it in the destination register, an address unit arithmeticoperation stores the calculated address in the destination register.Buffer 655 supplies the output from global temporary address registerGTA 651 to global port source data bus Gsrc 105 for supply to aspecified destination register when the instruction word indicates signextend and a load operation. Similarly, buffer 656 supplies the outputfrom local temporary address register LTA 652 to local port bus Lbus 103for supply to a specified destination register when the instruction wordindicates sign extend and a load operation. Under these conditionscontrol circuits 653 and 654 do not generate their control signals tocrossbar 50. Thus the generated address is diverted from the address busof crossbar 50 to the corresponding digital image/graphics processordata bus.

Address unit arithmetic operations enable additional parallel arithmeticoperations. In the preferred embodiment, each digital image/graphicsprocessor 71, 72, 73 and 74 can perform a multiply and three additionsin one instruction. It is preferably also possible to perform amultiply, two additions and a data transfer operation in parallel in oneinstruction. All of the indexing, address modification and offsetoperations available for the corresponding load operation are availableduring address unit arithmetic. Thus an address unit arithmeticoperation can compute a result to be stored in the destination registerwhile also modifying a base address register either by pre-incrementing,post-incrementing, pre-decrementing or post-decrementing. An addressunit arithmetic operation adding an offset index to a zero base addressfrom address registers A15/A7 can load an offset field in parallel withany data unit operation. Address unit arithmetic operations can beperformed conditionally in the same manner as conditional datatransfers. As in other conditional data transfers modification of thebase address register occurs unconditionally, only the transfer of theresult is conditional. The preferred embodiment also supports addressunit arithmetic of patched addresses. Like all other addresscomputations address unit arithmetic calculations occur in the addresspipeline stage and are written to the destination register during theexecute pipeline stage. Note that the "address" computed during anaddress unit arithmetic operation is not checked for range. This isbecause no actual memory access occurs when an address unit arithmeticoperation executes.

Address unit arithmetic operations are best used to reduce the number ofinstructions needed for a loop kernel in a loop that is repeated a largenumber of times. Graphics and image operations often require largenumbers of repetitions of short loops. Often reduction of a loop kernelby only a single instruction can greatly improve the performance of theprocess.

Data transfers between digital image/graphics processor 71 and memory 20are made via data port unit 140. Data port unit 140 handles dataalignment, sign or zero extension and the like for data passing through.FIG. 30 illustrates details of this portion of buffer 147 illustrated inFIG. 3. Note that this same structure could also be used withinmultiplexer buffer 143 of local data port 141. Data from the crossbardata bus is divided into four data streams of 8 bits each. Dataalignment multiplexer 151 selects and aligns the received data basedupon the current data size, endian mode and the two least significantbits of the generated address. For a data size of 32 bits, no selectionor alignment is needed and the four 8 bit data streams pass through dataalignment multiplexer 151 unchanged. For a data size of 16 bits, dataalignment multiplexer 151 selects either the most significant 16 bits orthe least significant 16 bits for supply via the 16 least significantoutput bits. This selection contemplates the current endian mode andaddress bits 1-0. If address bit 1 is "0", then data alignmentmultiplexer 151 selects the least significant 16 bits in little endianmode and the most significant bits in big endian mode. The oppositeselection is made if address bit 1 is "1". Similarly, if the data sizeis 8 bits, data alignment multiplexer 151 selects either bits 31-24,bits 23-16, bits 15-8 or bits 7-0 based upon the current endian mode andaddress bits 1-0.

Once the data selection and alignment have been made, sign/zero extendmultiplexer 152 provides sign or zero extension. For the case of 32 bitdata, no sign or zero extend is made and the data passes throughsign/zero extend multiplexer 152 unchanged. Bus drivers 153 then supplythe corresponding destination bus; global port data destination bus Gdst107 for the global port and local port data bus Lbus 103 for the localport. If the data size is 16 bits, then sign/zero extend multiplexer 152passes data bits 15-0 unchanged. For this case data bits 31-16 arefilled with "0" if zero extension is selected. Data bits 31-16 are signextended, that is filled with the state of bit 15, is sign extension isselected. For 8 bit data, sign/zero extend multiplexer 152 passes bits7-0 unchanged. Bits 31-8 are filled with "0" if zero extension isselected and filled with the state of bit 7 is sign extension isselected.

This data selection, alignment, and sign or zero extension is availablefor register to register moves as well as register loads from memory.For register to register moves the instruction word includes a fieldthat specifies a two bit item number. This item number, treated as if inlittle endian mode, substitutes for the address bits 1-0. In otherrespects the circuit illustrated in FIG. 30 operates as just described.

Data port unit 140 operates specially for local port illegal addresses.Recall that each local port can only address memories corresponding tothat digital image/graphics processor. If the local address unit 620generates an address outside its permitted range, then this address isshunted to global address port 121. If a global port access is alsospecified for that instruction, this is serviced first and then thelocal port access is serviced via global address port 121. Under theseconditions during a store operation data from local data port bus Lbus103 supplies buffer multiplexer 146, which supplies to the addressedmemory location via global data port 148. Similarly, when using theglobal port for a local load operation buffer multiplexer 143 suppliesthe received data from global data port 148 to local port data bus Lbus103.

FIG. 31 illustrates in block diagram form program flow control unit 130.Program flow control unit 130 performs all the operations that occurduring the fetch pipeline stage. Program flow control unit 130 controls:fetching instruction words from the corresponding instruction cache;instruction cache management including handshakes with transfercontroller 80; program counter modification by branches, interrupts andloops; pipeline control, including control over data unit 110 andaddress unit 120; synchronization with other digital image/graphicsprocessors in synchronized MIMD mode; and receipt of command words fromother processors. As illustrated in FIG. 31 program flow control unit130 includes the following registers: program counter PC 701;instruction pointer-address stage IPA 702; instruction pointer-executestage IPE 703; instruction pointer-return from subroutine IPRS 704;three loop end registers LE2-LE0 711, 712 and 713; three loop startregisters LS2-LS0 721, 722 and 723; three loop counter registers LC2-LC0731, 732 and 733; three loop reload registers LR2-LR0 741, 742 and 743;loop control register LCTL 705; interrupt enable register INTEN 706;interrupt flag register INTFLG 707; four cache tag registers TAG3-TAG0,collectively called cache tag registers 708; a read only CACHE register709; and a communications register COMM 781. There are two sets of writeonly register addresses (LRS2-LRS0 and LRSE2-LRSE0) employed for fasthardware loop initialization. These will be further discussed below.

Program flow control unit 130 also includes an instructionregister-address stage IRA 751 and an instruction register-executionstage IRE 752. These registers are not user accessible and do not appearin the register space. Instruction register-address stage IRA 751contains the instruction word for the current address pipeline stage.Instruction register-execution stage IRE 752 contains the instructionword for the current execute pipeline stage. These registers control theoperations during the respective address and execute pipeline stages.The program flow control unit 130 pushes the fetched instruction wordlocated at the address in program counter PC 701 into the instructionregister-address stage IRA 751. In addition, the pipeline pushes theinstruction word in the instruction register-address stage IRA 751 intothe instruction register-execute stage IRE 752 upon each pipeline stageadvance.

Program flow control unit 130 operates predominantly in the Fetchpipeline. Since the program flow control unit 130 contains theinstruction register-address stage IRA 751 and instructionregister-execute stage IRE 752, it extracts and distributes controlinformation needed by data unit 110 and address unit 120 via opcode bus133. Program flow control unit 130 also controls the aligner/extractorson the data port unit 140.

The major task of program flow control unit 130 is control ofinstruction fetch during the fetch pipeline stage. The address of thenext instruction word to be fetched is stored in program counter PC 701.FIG. 32 illustrates schematically the bits of program counter PC 701. Inthe preferred embodiment of this invention, internal and external memoryis byte addressable. That is, each address word points to a byte (8bits) of data in memory. As explained in detail below, each instructionword of digital image/graphics processor 71 is a 64 bit double word,which is 8 bytes. Since these instruction words are aligned on evendouble word boundaries, only 29 bits are necessary to specify any suchinstruction word. As illustrated in FIG. 32 bits 31-3 of program counterPC 701 provide this 29 bit double word address. During normal sequentialinstruction operation program flow control unit 130 increments bit 3 ofprogram counter PC 701 to address the next 64 bit instruction.

Program counter PC 701 has two write register addresses. Writing toprogram counter PC 701 executes a subroutine call. The write altersprogram counter PC 701. At the same time program flow control unit 130causes the previous contents of program counter PC 701 to be writteninto instruction pointer-return from subroutine IPRS 704. This enables areturn instruction to reload program counter PC 701 from instructionpointer-return from subroutine IPRS 704. Writing to a different registeraddress designated branch BR executes a software branch. This writealters only program counter PC 701 and instruction pointer-return fromsubroutine IPRS 704 is unchanged.

As noted above bits 2-0 of program counter PC 701 are not needed tospecify instruction words. These otherwise unused bits are employed tospecify other things. These bits include an "S" bit (bit 2), a "G" bit(bit 1) and an "L" bit (bit 0).

The "S" bit (bit 2) indicates whether the digital image/graphicsprocessor 71 is in the synchronized MIMD mode. As previously described,when in the synchronized MIMD mode program control flow unit 130inhibits fetching the next instruction word until all synchronizedprocessors are ready to proceed. If the "S" bit is "1", then the digitalimage/graphics processor 71 is currently executing synchronized code.Note that the identity of the other digital image/graphics processorssynchronized to digital image/graphics processor 71 is stored in thecommunications register COMM 781. Otherwise, digital image/graphicsprocessor 71 will not wait for other digital image/graphics processorsto be ready before fetching the next instruction word. Execution of alock instruction (LCK) sets this "S" bit of program counter PC 701during the address pipeline stage to enable synchronized MIMD mode.Execution of an unlock (UNLCK) instruction clears this "S" bit duringthe address pipeline stage thus disabling the synchronized MIMD mode.Normal register writes to program counter PC 701 do not change the stateof this "S" bit.

The "G" bit (bit 1) indicates whether global interrupts are enabled.When this "G" bit is "0", the program flow control unit 130 ignores allinterrupt sources, except the emulation trap. If this "G" bit is "1",then program flow control unit 130 responds to those interrupt sourcesindividually enabled in interrupt enable register INTEN 706. Executionof an enable interrupt instruction (EINT) sets this "G" bit of programcounter PC 701 during the address pipeline stage to enable interrupts.Execution of a disable interrupt instruction (DINT) clears this "G" bitduring the address pipeline stage of thereby disabling most interruptsources. Normal register writes to program counter PC 701 do not changethe state of this "G" bit.

The "L" bit (bit 0) indicates whether hardware loop logic is enabled.This hardware loop logic will be fully described below. If the "L" bitis "1", then the hardware loop logic is disabled. Otherwise, hardwareloops are individually enabled according to the loop control registerLCTL 708. Hardware loops are normally disabled via this "L" bit onlyduring the return sequence from an interrupt, because loops are"unwrapped" during the entry into an interrupt routine. Normal registerwrites to program counter PC 701 do not change the state of this "L"bit.

FIG. 33 illustrates schematically the bits of instructionpointer-address stage IPA 702. This register is loaded with the contentsof program counter PC 701 upon each pipeline stage advance. In the firsttwo pseudo-instructions of an interrupt, the "L" bit (bit 0) ofinstruction pointer-address stage IPA 702 is forced to "1" whatever thestate of this bit in program counter PC 701. The other bits of programcounter PC 701 are copied into instruction pointer-address stage IPA 702without alteration. This register stores the address of the instructioncurrently in the Address pipeline stage.

Instruction pointer-execute stage IPE 703 is loaded with the contents ofinstruction pointer-address stage IPA 702 upon each pipeline stageadvance. This register is useful in relative program countercomputations. Note that instruction pointer-execute stage IPE 703 storesthe address of the instruction currently in the execute pipeline stage.Using this register for relative program counter computations is betterthan using program counter PC 701 due to the possibility of branches,loops or interrupts and because no offset is required.

Instruction pointer-return from subroutine register IPRS 704 stores thesubroutine return address. FIG. 34 illustrates the bits of this registerschematically. Instruction pointer-return from subroutine register IPRS704 is updated with the address previously stored in program counter PC701 incremented at bit 3 whenever software writes to program counter PC701. This is the address following the second delay slot of the softwarebranch. Thus, as implied by the name, instruction pointer-return fromsubroutine register IPRS 704 stores the address for returns fromsubroutines. Executing a return instruction loads the address stored ininstruction pointer-return from subroutine register IPRS 704 intoprogram counter PC 701 during the execute pipeline stage. Only bits 31-3of instruction pointer-return from subroutine register IPRS 704 areused. Bits 2-0 of program counter PC 701 are not stored in instructionpointer-return from subroutine IPRS 704 upon a software branch and thesebits are not read from instruction pointer-return from subroutine IPRS704 during restoration of program counter PC 701.

The program flow control unit of each digital image/graphics processorincludes an instruction cache controller 760. This instruction cachecontroller 760 includes a set of four cache tag registers TAG3-TAG0 708,a least recently used control circuit 761 and an address encoder 762.The instruction cache controller 760 controls a section of memorydedicated to instruction caching for that digital image/graphicsprocessor. This instruction cache memory is preferably 2K bytes in size.Instruction cache controller 760 treats the instruction cache memory asholding 256, 64 bit instructions in one set with 4 blocks supported by4-way least recently used operations. Each block has 4 sub-blocks of 16instructions. Thus each of the cache tag registers TAG3-TAG0 708includes 4 "present" bits for a total of 16 "present" bits.

FIG. 35 illustrates the fields of each cache tag register TAG3-TAG0. Thetag value field (bits 31-9) of each of the tag registers holds a tagvalue. This tag value is the virtual address of the start of thecorresponding cache block in the instruction cache memory. Sub-blockpresent bits (bits 8-5) of each cache tag register TAG3-TAG0 areassociated with the respective four sub-blocks 3-0 in the block to whichthat cache tag register relates. Thus bit 8 represents the mostsignificant sub-block and bit 5 represents the least significantsub-block. The "LRU" field (bits 1-0) indicates how recently the blockwas used. These bits are as defined in Table 31.

                  TABLE 31                                                        ______________________________________                                        LRU                                                                             bits Position in                                                              1 0 use stack                                                               ______________________________________                                        0 0             most-recently used                                              0 1 next-most recently used                                                   1 0 next-least recently used                                                  1 1 least recently used                                                     ______________________________________                                    

Bits 4 to 2 of cache tag registers TAG3-TAG0 708 are not implemented.These bits are reserved for a possible extension of the instructioncache memory to include additional sub-blocks. Cache tag registersTAG3-TAG0 708 appear in the register map as listed in Tables 37 and 38.

Instruction cache controller 760 of each digital image/graphicsprocessor 71, 72, 73 or 74 may be flushed by master processor 60 or bythe digital image/graphics processor itself. Note that a cache flushresets only the cache tag registers TAG3-TAG0 708 within program flowcontrol unit 130 and does not clear data from the correspondinginstruction cache memory. An instruction cache flush is performed bywriting a cache flush command word to address register A15 with the "I"bit (bit 28) set. Reset does not automatically flush the cache. Aninstruction cache flush causes the cache tag value field to be set tothe cache tag register's own number (i.e., TAG3=3, TAG2=2, TAG1=1,TAG0=0), clears all their present bits, and sets the LRU bits to the tagregister's own number (i.e., TAG3(LRU)="11", TAG2(LRU)="10",TAG1(LRU)="01" and TAG0(LRU)="00"). Cache tag register TAG3 is thus theleast-recently-used following a cache flush.

Program flow control unit 130 compares corresponding bits of the addressstored in program counter PC 701 to the cache tag registers TAG3-TAG0708 during each fetch pipeline stage. This comparison yields either acache miss result or a cache hit result. A cache miss may be either ablock miss or a sub-block miss. In a block miss the most significant 23bits of program counter PC 701 does not equal the corresponding 23 bitsof any of the cache tag registers TAG3-TAG0 708. In this case, leastrecently used control circuit 761 chooses the least recently used blockto discard, and clears all the present bits of the corresponding cachetag register. In a sub-block miss the most significant 23 bits ofprogram counter PC 701 matches the corresponding 23 bits of one of thecache tag registers TAG3-TAG0 708, but the present bits (one of bits 8-5of the tag register) indicating presence of the sub-block correspondingto bits 8-7 of program counter PC 701 is "0". This means that one of thecache tag registers TAG3-TAG0 708 is assigned that memory block, butthat the sub-block is not present within the instruction cache.

If either type of cache miss occurs, then program flow control unit 130requests transfer controller 80 to service the instruction cache memoryvia an external access. Program control flow unit 130 passes theexternal address and the internal sub-block address to the transfercontroller 80. Program flow control unit 130 signals transfer controller80 the cache miss information via crossbar 50. Transfer controller 80services the cache miss by fetching the entire sub-block of instructionsincluding the address of the currently sought instruction word. Thisblock of instructions is stored in the least recently used block withinthe instruction cache memory 21, 26, 31 and 36 corresponding to therequesting digital image/graphics processor 71, 72, 73 and 74,respectively. Program flow control unit 130 then sets the proper valuesin the corresponding cache tag register TAG3-TAG0 708. The instructionfetch operation is then repeated, with a cache hit guaranteed.

Cache miss information may be accessed by reading from the register inthe register space at register bank "1111" register number "000". Thisregister is called the CACHE register 709 in Table 38. Program flowcontrol unit 130 provides 27 bits. These 27 bits are the 23 mostsignificant address of program counter PC 701 (the tag bits) plus 2sub-block bits from cache tag registers TAG3-TAG0 708 and two bitsencoding the identity of the least-recently-used block from leastrecently used control circuit 761. CACHE register 709 is read only, anyattempt to write to write to this register is ignored. Thus CACHEregister 709 is connected to only global port source data bus Gsrc bus105 and not connected to global port destination data bus Gdst 107.

If a cache hit occurs, then the desired instruction word is stored inthe corresponding instruction cache. As previously described, eachinstruction cache memory 21, 26, 31, 36 includes 2K bytes. Sinceinternal and external memory is byte addressable in the preferredembodiment, 11 address bits are required. However, each instruction isaligned with a 64 bit double word boundary and thus the three leastsignificant bits of an instruction address are always "000". The 2 mostsignificant bits of the 11 bit instruction address on instruction portaddress bus 131 correspond to the cache tag register TAG3-TAG0 708successfully matched with program counter PC 701. These address bits10-9 are encoded as shown in Table 32.

                  TABLE 32                                                        ______________________________________                                                Address                                                                             Cache                                                             bits tag                                                                      10 9  register                                                              ______________________________________                                                0 0   TAG0                                                              0 1 TAG1                                                                      1 0 TAG2                                                                      1 1 TAG3                                                                    ______________________________________                                    

The bits 8-3 of the instruction address on instruction port address bus131 are bits 8-3 of the 29 bit double word address stored in programcounter PC 701. The cache tag comparison is made fast enough to outputthe 8 bit address via the instruction port with an implied read signalfrom the digital image/graphics processor to the correspondinginstruction cache memory. This retrieves the addressed 64 bitinstruction word into instruction register-address stage IRA 751 beforethe end of the fetch pipeline stage.

Program flow control unit 130 next updates program counter PC 701. Ifthe next instruction is at the next sequential address, program controlflow unit 130 post increments program counter PC 701 during the fetchpipeline stage. Note this post increment means that program counter PC701 stores the address of the next instruction to be fetched. Otherwise,program control flow unit 130 loads the address of the next instructioninto program counter PC 701 according to loop logic 720 (FIG. 37) orsoftware branch. When in the synchronized MIMD mode, program flowcontrol unit delays the instruction fetch until all the digitalimage/graphics processors specified by sync bits in communicationsregister COMM 781 are synchronized.

Program flow control unit 130 includes loop logic 720 employed with anumber of registers in nested zero-overhead looping and a variety ofother powerful instruction flow control functions. Examples of theseother functions include: multiple ends to the same loop; zero-delaybranches without necessarily returning; zero-delay "calls and returns";and conditional zero-delay branches. The basic function of loop logic720 is nested zero-overhead looping. For each of three possible loopsthere are four registers. These are: loop end registers LE2 711, LE1 712and LE0 713; loop start registers LS2 721, LS1 722 and LS0 723; loopcount registers LC2 731, LC1 732 and LC0 733; and loop reload registersLR2 741, LR1 742 and LR0 743. The entire loop logic process iscontrolled by the status of loop logic control register LCTL 705 inconjunction with the loop enable bit (bit 0) of program counter PC 701.In addition there are several register address locations LRS2-LRS0 andLRSE2-LRSEO that simultaneously load more than one of the primaryregisters.

Each set of four registers controls an independent zero-overhead loop. Azero-overhead loop is the solution to a problem caused by the pipelinestructure. A software branch performed by loading an address intoprogram counter PC 701 occurs during the execute pipeline stage. Such abranch does not take place immediately because it does not change twoinstructions that were already fetched and in the instruction pipeline.These two instructions were fetched during the previous two fetchpipeline stages. This delay in branch implementation is called apipeline hit and the two instructions following the branch instructionare called delay slots. Sometimes clever programming enables useful workduring the delay slots, but this is not always possible. Loop logic 720operates during the fetch pipeline stage and, once some set up isaccomplished, enables loops and branches without pipeline hits. Notethat once the appropriate registers are loaded loop logic 720 does notrequire a branch instruction during looping and does not produce anydelay slots. This loop logic 720 may be especially useful in algorithmswith nested loops with numerous repetitions.

A simple example of loop logic 720 operation follows. Set up of looplogic 720 includes loading a particular loop end register, and thecorresponding loop start register, loop count register and loop reloadregister. For example the loop end address is loaded into loop endregister LE0 713, the loop start address is loaded into loop startregister LS0 723 and the number of loop repetitions desired is loadedinto loop count register LC0 733 and loop reload register LR0 743.During each fetch pipeline stage loop logic compares the address storedin program counter PC 701 with the loop end address stored in loop endregister LE0 713. If the current program address equals the loop endaddress, loop logic 720 determines if the loop count stored in thecorresponding loop count register, in this case loop count register LC0733, is "0". If the loop count is not "0", then loop logic 720 loads theloop start address stored in loop start register LS0 723 into programcounter PC 701. This repeats the loop starting from the loop startaddress. In addition, loop logic 720 decrements the loop count stored inthe corresponding loop count register, in this case loop count registerLC0 733. If the loop count in the corresponding loop count register is"0", then no branch is taken. Program flow control unit 130 incrementsprogram counter PC 701 normally to the next sequential instruction. Inaddition, loop logic 720 loads the loop count stored in the loop reloadregister LR0 into the loop count register LC0. This prepares loop logic720 for another set of repetitions and is useful for inner loops ofnested loops. Because all these processes occur during the fetchpipeline state no pipeline hit takes place.

FIG. 36 illustrates loop logic control register 705. Loop logic controlregister 705 controls operation of loop logic 720 based upon data storedin three sets of bits corresponding to the three loop end registersLE2-LE0 711-713. Loop logic control register 705 bits 3-0 control theloop associated with loop end register LE0 713, bits 7-4 control theloop associated with loop end register LE1 712, and bits 11-8 controlthe loop associated with loop end register LE2 711. The "E" bits (bits11, 7 and 3) are enable bits. A "1" in the "E" bit enables the loopcorresponding the associated loop end register. A "0" disables theassociated loop. Thus setting bits 11, 7 and 3 to "0" completelydisables loop logic 720. Each loop end register LE2-LE0 has anassociated "LCn" field that assigns a loop count register LC2-LC0 forthat loop end register. The coding of the "LCn" field is given in Table

                  TABLE 33                                                        ______________________________________                                               LCn   Loop Count                                                         field Register                                                              ______________________________________                                               0 0 0 none                                                               0 0 1 LC0                                                                     0 1 0 LC1                                                                     0 1 1 LC2                                                                     1 X X reserved                                                              ______________________________________                                    

The assigned loop count register stores the corresponding loop count andis decremented each time the program address reaches the associated loopend address. Although the "LCn" field is coded to allow every loop endregister to use any loop count register, not all combinations aresupported in the preferred embodiment. In the preferred embodiment the"LCn" field may assign: loop count register LC2 or LC0 to loop endregister LE2 711; register LCl or LC0 to loop end register LE1 712; andonly loop count register LC0 to loop end register LE0 713. In the caseof a "LCn" field of "000", no loop count register is used and theprogram always branches to the loop start address stored in thecorresponding loop start register. Also note that if bit 0 of programcounter PC 701 is "0", then loop logic 720 is inhibited regardless ofthe status of loop control register LCTL 705. This permits loop logicinhibition without losing the assignment of loop count registers to loopend registers. When the count in the assigned loop count registerreaches "0", encountering the loop end address does not load programcounter PC 701 with the address in the corresponding loop startregister. Instead the loop count register is reloaded with the contentsof the corresponding loop reload register LR2-LR0. By assigning loopcounter register LC0 733 to two or three loop end registers LE2-LE0,multiple end points to a loop are supported. Note that the mostsignificant bits of loop control register LCTL 705 and the "1XX" codingsof the respective "LCn" fields are reserved for a possible extension ofthe loop logic to include more loops.

FIG. 37 illustrates loop logic 720. Loop logic 720 includes previouslymentioned: program counter PC 701; loop logic control register LCTL 705;the three loop end registers LE2-LE0 711, 712 and 713; the three loopstart registers LS2-LS0 721, 722 and 723; the three loop counterregisters LC2-LC0 731, 732 and 733; the three loop reload registersLR2-LR0 741, 742 and 743; comparitors 715, 716 and 717; priority logic725; loop logic control register "LCn" field decoders 735, 736 and 737;and zero detectors 745, 746 and 747. The respective "E" fields of looplogic control register LCTL 705 selectively enable comparitors 715, 716and 717 and loop logic control register "LCn" field decoders 735, 736and 737. Comparitors 715, 716 and 717 compare the address stored inprogram counter PC 701 with respective loop end registers LE2 711, LE1712 and LE0 713. Loop logic control register "LCn" field decoders 735,736 and 737 decode respective "LCn" fields of loop logic controlregister LCTL 705, ensuring that the assigned loop count registerLC2-LC0 is decremented upon reaching a loop end. Zero detectors 745, 746and 747 enable reload of respective loop count registers 731, 732 and733 from the corresponding loop reload registers 741, 742 and 743 whenthe loop count reaches "0".

Priority logic 725 decrements the assigned loop count register LC2-LC0or loads program counter PC with the loop start address in loop startregister LS2-LS0 depending upon the corresponding zero detection. If twoor three loops end at the same address then priority logic 725 setpriorities for the loop end registers in the order from loop endregister LE2 (highest) to loop end register LE0 (lowest). If no zerodetector 745, 756 or 747 detects "0", then the loop start registerLS2-LS0 associated with the highest priority loop end register LE2-LE0matching the program counter PC 701 is loaded into program counter PC701 and the loop count register LC2-LC0 assigned to that highestpriority loop end register LE2-LE0 is decremented. If at least one zerodetector 745, 756 or 747 detects zero, then the zero-value loop countregister LC2-LC0 corresponding to each zero value loop end registerLE2-LE0 matched is reloaded from the corresponding loop reload registerLR2-LR0 and the non-zero loop count register LC2-LC0 assigned to thehighest priority non-zero loop end register LE2-LE0 matched isdecremented. Program counter PC 701 is loaded with the loop startaddress associated with the highest priority loop end register that hasa corresponding non-zero loop count register. Zero detector 747 has adisable line to zero detector 746 to disable zero detector 746 fromcausing reload if zero detector 747 detects a zero. Both zero detectors747 and 746 may disable zero detector 745 from causing reload if eitherzero detector 747 or 746 detect zero. Thus three nested loops may end atthe same instruction with the loop associated with loop end register LS2711 the inner loop, and the loop associated with loop end register LS0the outer loop.

Loops can have any number of instructions within the address limit ofthe loop end registers LE2-LE0. Loop end registers LE2-LE0 and loopstart registers LS2-LS0 preferably include 29 address bits in the samefashion as program counter PC 701. The number of repetitions possible islimited by the capacity of the loop count registers and the loop reloadregisters. In the preferred embodiment the loop count registers LC2-LC0and the loop reload registers LR2-LR0 each have 32 bits as mostregisters on digital image/graphics processor 71. For the sake of size,the capacity of the loop count and loop reload registers may be limitedto 16 bits rather than 32 bits. In this case, the most significant 16bits of these registers are not implemented. With 16 bit loop count andloop reload registers loops larger than 2¹⁶ =65536 can be implementedusing outside software loops to restart the hardware loops. Theaddresses for loop starts and loop ends can be coincident, resulting ina single instruction loop.

FIG. 38 illustrates an example of a program having three ends to oneloop. This is achieved by assigning loop count register LC0 733 to eachof the loop end registers LE2-LE0. In the example illustrated in FIG. 38loop start register LC0 723 and loop start register LC2 721 store thesame address. Loop start register LC1 722 stores a different startaddress. The program begins at block 801. Processing block 802initializes the loops including storing the respective loop endaddresses in loop end registers LE2-LE0, storing the respective loopstart addresses in loop start registers LS2-LS0, loading loop controlregister LCTL 705 to enable all three loops and assign loop countregister LC0 733 to all loop end registers LE2-LE0. Processing block 803is an instruction block 0 starting at loop start address 1. Processingblock 804 is an instruction block 1 starting at start address 0 and 2.Decision block 805 is a conditional branch instruction 1. Decision block806 is a conditional branch instruction 2. Assuming neither condition 1nor condition 2 is satisfied, then the program executes processing block807 consisting of instruction block 3. Decision block 808 is thehardware loop decision corresponding to the loop end address stored inloop end register LE0 713. If the count stored in loop count registerLC0 is non-zero, the program flow returns to loop start address 0 thatrepeats the loop starting with instruction block 1. If the count storedin loop count register LC0 is "0", the program ends at end block 813. Inthe case that condition 1 is not satisfied and condition 2 is satisfied,then the program executes processing block 809 consisting of instructionblock 4. Decision block 810 is the hardware loop decision correspondingto the loop end address stored in loop end register LE2 711. If thecount stored in loop count register LC0 is non-zero, the program flowreturns to loop start address 2 that is the same as loop start address 0which repeats the loop starting with instruction block 1. If the countstored in loop count register LC0 is "0", the program ends at end block813. In the case that condition 1 is satisfied, then the programexecutes processing block 811 consisting of instruction block 5.Decision block 812 is the hardware loop decision corresponding to theloop end address stored in loop end register LE1 712. If the countstored in loop count register LC0 is non-zero, the program flow returnsto loop start address 1 and repeats the loop starting with instructionblock 0. If the count stored in loop count register LC0 is "0", theprogram ends at end block 813. The loop could finally terminate at anyof the loop end addresses according to the condition encountered by theconditional branches on the final time through the loop.

To save instructions during loop initialization, any write to a loopreload register LR2-LR0 writes the same data to the corresponding loopcount register LC2-LC0. In the preferred embodiment, writing to a loopcount register LC2-LC0 does not affect the corresponding loop reloadregister LR2-LR0. The reason for this difference will be explainedbelow. When restoring loop values after task switches, the loop reloadregisters LR2-LR0 should be restored before restoring the loop countregisters LC2-LC0. Thus the form for initializing a single loop is:##EQU5## This procedure is suitable for loading a number of loops, whichexecute for a long time. This initialization procedure is repeated toimplement additional loops. Note that since the loop registers areloaded by software in the execute pipeline stage and used by thehardware in the fetch pipeline stage, there should be at least twoinstructions between loading any loop register and the loop end addresswhere that loop register will be used.

The loop start address and the loop end address can be made independentof the position of the loop within the program by loading the loop startregister LS2-LS0 and the loop end register LE2-LE0 as offsets toinstruction pointer-execute stage register IPE 703. Recall thatinstruction pointer-execute stage register IPE 703 stores the address ofthe instruction currently in the execute pipeline stage. For example,the instruction:

    LS0=IPE+88

loads loop start register LS0 723 with a value 11 instructions (88bytes) ahead of the current instruction. A similar instruction can loada loop end register LE2-LE0.

The preferred embodiment of this invention includes additional registeraddresses to support even faster loop initialization for short loops.There are two sets of such register addresses, one set formulti-instruction loops and one set for single instruction loops.Writing to one of the register addresses LRS2-LRS0 used formulti-instruction loops loads the corresponding loop reload registerLR2-LR0 and its corresponding loop counter LC2-LC0. This write operationalso loads the corresponding loop start LS2-LS0 register with theaddress following the current address stored in program counter PC 701.This write operation also sets corresponding bits in loop controlregister LCTL 708 to enable the relevant loop. Thus, if n is a registerset number from 2-0, writing to LRSn: loads LRn and LCn with thespecified count; loads LSn with PC+1; loads LCTL to enable LEn andassign LCn. These operations all occur in a single cycle, during theexecute pipeline stage. There thus must be two delay slots between thisinstruction and the start of the loop. The instruction sequence for thismulti-instruction loop short form initialization is:

    ______________________________________                                                         LEn = loop end address                                          LRSn = count                                                                  delay slot 1                                                                  delay slot 2                                                                 loop start address: 1st.sub.-- instruction.sub.-- in.sub.-- loop                               loop.sub.-- instruction                                       loop.sub.-- instruction                                                      loop end address: last.sub.-- instruction.sub.-- in.sub.-- loop             ______________________________________                                    

Note that the loop could be as long as desired within the register spaceof the corresponding loop end register and loop start register. Alsonote that writing to LRSn automatically sets the loop start address asthe instruction following the second delay slot.

Another set of register addresses is used for short form initializationof a single instruction loop. Writing to one of the register addressesLRSE2-LRSE0 initializes a single instruction loop. If n is a registerset number from 2-0, writing to LRSEn: loads loop reload register LRnand loop count register LCn with the count; loads loop start registerLSn with the address following the address currently in program counterPC 701; loads loop end register LEn with the address following theaddress currently in program counter PC 701; and sets loop controlregister LCTL 705 to enable loop end register LEn and assign loop countregister LCn. As with writing to LRSn, these operations all occur in asingle cycle during the execute pipeline stage and two delay slots arerequired between this instruction and the start of the loop. Theinstruction sequence for this single instruction loop short forminitialization is:

    ______________________________________                                                         LRSEn = count                                                   delay slot 1                                                                  delay slot 2                                                                 loopn: one.sub.-- instruction.sub.-- loop                                   ______________________________________                                    

This instruction sequence sets the loop start and loop end to the sameaddress. This thus allows a single-instruction to be repeated count+1times.

These short form loop initializations calculate the loop start addressand the loop end address values from the address stored in programcounter PC 701. They should therefore be used with care within the delayslots of a branch. If the branch is taken, the loop start address, andthe loop end address for the case of LRSE2-LRSE0, is calculated afterprogram counter PC 701 is loaded with the branch address. This effectcan be annulled if the branch is conditional, by setting the loopinitialization to be conditional upon the inverse condition.

These short form loop initializations and the standard loopinitialization, do involve delay slots in much the same manner assoftware branches. However, the delay slots necessary for loopinitialization occur once each loop initialization. The delay slots forbranches formed with software loops occur once each branch instruction.In addition, there is a greater likelihood that useful instructions canoccupy the delay slots during loop initialization than during loopbranches. Thus the overhead needed for loop initialization can be muchless than the overhead involved in software branches, particularly inshort loops.

Software branches have priority over loop logic 720. That is if a loopend register LE2-LE0 stores the address of the second delay slotinstruction following a program counter load operation, then loop logic720 is inhibited for that cycle. Thus the loop counter is notdecremented, nor will any loop logic 720 program counter load takeplace. This enables a conditional software exit from a loop. If the looplogic 720 hardware loop has a single conditional branch instruction,then this instruction may be executed three times if the conditionremains true. This is illustrated in FIG. 39. In instruction slot 901the branch condition is not true so the branch is unsuccessful. Looplogic 720 has already reloaded the same instruction during the fetchpipeline stage of instruction slot 902. In instruction slot 902 thebranch condition is true and the branch is taken, thereby loading theaddress of a target instruction into program counter PC 701. This changein program counter PC 701 does not change the two already loadedexamples of the branch instruction in the pipeline in instruction slots903 and 904. Assuming the branch condition is still true, the executepipeline stage of these instruction slots loads the address of thetarget instruction into program counter PC 701. Thus the branch is takenthree times in instruction slots 902, 903 and 904 and the targetinstruction executes three times in instruction slots 905, 906 and 906.Finally in instruction slot 908 the instruction following the targetinstruction is reached. As further explained below, the single branchinstruction may be coded with parallel operations that would also beexecuted multiple times and that may change the branch condition.

Loop control logic 720 permits zero delay branches and zero delayconditional branches. In these cases the address of the point from whichthe branch is to be taken is loaded into a loop end register LE2-LE0.The destination address of the branch is loaded into the assigned loopstart register LS2-LS0. Zero-delay branches may be implemented in twoways. Following loop initialization, the assigned loop count registerLC2-LC0 is set to a non-zero number. Alternatively, the corresponding"LCn" field in loop control register LCTL 705 may be set to "000". Ineither case the branch will always be taken during the fetch pipelinestage with no pipeline hit or delay slots. Conditional zero-delaybranches (flow chart diamonds) are implemented similarly. Duringinitialization the corresponding loop count register LC2-LC0 is assignedto the loop end register LE2-LE0 by setting the corresponding "LCn"field in loop control register LCTL. Before the conditional branch, aconditional value is loaded into the assigned loop count registerLC2-LC0. Upon encountering the loop end address, either the branch istaken to the loop start address stored in the corresponding loop startregister LS2-LS0 if the conditional value is non-zero, or the branch isnot taken if the conditional value is zero. Since the loop registers areloaded by software in the execute pipeline stage and used by thehardware in the fetch pipeline stage, there should be at least twoinstructions between loading any loop register and the branch orconditional branch instruction at the loop end address. Otherwise, theprevious value for that loop register is used by loop logic 720.

Referring back to FIG. 31, program flow control unit 130 handlesinterrupts employing interrupt enable register INTEN 706 and interruptflag register INTFLG 707. Program flow control unit 130 may support upto 32 interrupt sources represented by selectively setting bits ofinterrupt flag register INTFLG 707. Each source can be individuallyenabled via interrupt enable register INTEN 706. Pending interrupts arerecorded in interrupt flag register INTFLG 707, which latches interruptrequests until they are specifically cleared by software, normallyduring the interrupt routine. The individual interrupt flag canalternatively be polled and cleared by a software loop.

FIG. 40 illustrates the field definitions for interrupt enable registerINTEN 706 and interrupt flag register INTFLG 707. The bits labeled "r"are reserved for future use and bits labeled "--" are not implemented inthe preferred embodiment but may be used in other embodiments.Interrupts are prioritized from left to right. Each interrupt source canbe individually enabled by setting a "1" in the corresponding Enable (E)bit of interrupt enable register INTEN 706. The interrupt source bits ofinterrupt flag register INTFLG 707 are in descending order of priorityfrom right to left: Emulation interrupt ETRAP, which is always enabled;XY patch interrupt; task interrupt; packet request busy interrupt PRB;packet request error interrupt PRERR; packet request successfulinterrupt PREND; master processor 60 message interrupt MPMSG; digitalimage/graphics processor 71 message interrupt DIGPOMSG; digitalimage/graphics processor 72 message interrupt DIGPlMSG; digitalimage/graphics processor 73 message interrupt DIGP2MSG; digitalimage/graphics processor 74 message interrupt DIGP3MSG. Bits 31-28 arereserved for message interrupts from four additional digitalimage/graphics processors in an implementation of multiprocessorintegrated circuit 100 including eight digital image/graphicsprocessors.

The "W" bit (bit 0) of interrupt enable register INTEN 706 controlswrites to interrupt flag register INTFLG 707. This bit would ordinarilycontrol whether the emulation interrupt is enabled. Since in thepreferred embodiment the emulation interrupt cannot be disabled there isno need for an enable bit for this interrupt in interrupt enableregister INTEN 706. Bit 0 of interrupt enable register INTEN 706modifies the behavior of the interrupt flag register INTFLG 707. Whenthe "W" bit of interrupt enable register INTEN 706 is "1", softwarewrites to interrupt flag register INTFLG 707 can only set bits to "1".Under these conditions, an attempt to write a "0" to any bit ofinterrupt flag register INTFLG 707 has no effect. When this "W" bit "0",writing a "1" to any bit of interrupt flag register INTFLG 707 clearsthat bit to "0". An attempt to write a "0" to any bit of interrupt flagregister INTFLG 707 has no effect. This allows individual interruptflags within interrupt flag register INTFLG 707 to be cleared withoutdisturbing the state of others. Each interrupt service routine shouldclear its corresponding interrupt flag before returning because theseflags are not cleared by hardware in the preferred embodiment. Theemulation interrupt ETRAP, the only exception to this, is cleared byhardware because this interrupt is always enabled. If a particularinterrupt source is trying to set a bit within interrupt flag registerINTFLG 707 simultaneously as a software write operation attempts toclear it, logic causes the bit to be set.

The ETRAP interrupt flag (bit 0 of interrupt flag register INTFLG 707)is set from either analysis logic or an ETRAP instruction. Thisinterrupt is normally serviced immediately because it cannot bedisabled, however interrupt servicing does wait until pipeline stallconditions such as memory contention via crossbar 50 are resolved. TheENTRAP interrupt flag is the only interrupt bit in interrupt flagregister INTFLG 707 cleared by hardware when the interrupt is serviced.

The XY PATCH interrupt flag (bit 11 of interrupt flag register INTFLG707) is set under certain conditions when employing the global addressunit 610 and local Address unit 620 combine to perform XY addressing. Aspreviously described in conjunction with FIG. 27 and the description ofaddress unit 120, XY patched addressing may generate interrupts oncertain conditions. The instruction word calling for XY patchedaddressing indicates whether such an interrupt may be generated andwhether a permitted interrupt is made on an address inside or outside adesignated patch.

The TASK interrupt flag (bit 14 in interrupt flag register INTFLG 707)is set upon receipt of a command word from master processor 60. Thisinterrupt causes digital image/graphics processor 71 to load its TASKinterrupt vector. This interrupt may cause a selected digitalimage/graphics processor 71, 72, 73 or 74 to switch tasks under controlof master processor 70, for instance.

The packet request busy interrupt flag PRB (bit 17 of interrupt flagregister INTFLG 707) is set if software writes a "1" to the packetrequest bit of communications register COMM 781 when the queue activebit is a "1". This allows packet requests to be submitted withoutchecking that the previous one has finished. If the previous packetrequest is still queued then this interrupt flag becomes set. This willbe further explained below in conjunction with a description ofcommunications register COMM 781.

The packet request error interrupt flag PRERR (bit 18 of interrupt flagregister INTFLG 707) is set if transfer controller 80 encounters anerror condition while executing a packet request submitted by thedigital image/graphics processor.

The packet request end interrupt flag PREND (bit 19 of interrupt flagregister INTFLG 707) is set by transfer controller 80 when it encountersthe end of the digital image/graphics processor's linked-list, or whenit completes a packet request that instructs transfer controller 80 tointerrupt the requesting digital image/graphics processor uponcompletion.

The master processor message interrupt flag MPMSG (bit 20 of interruptflag register INTFLG 707) becomes set when master processor 60 sends amessage-interrupt to that digital image/graphics processor.

Bits 27-24 of interrupt flag register INTFLG 707 log message interruptsfrom digital image/graphics processors 71, 72, 73 and 74. Note that adigital image/graphics processor 71, 72, 73 or 74 can send a message toitself and interrupt itself via the corresponding bit of interrupt flagregister INTFLG 707. The digital image/graphics processor 0 messageinterrupt flag DIGPOMSG (bit 24 of interrupt flag register INTFLG 707)is set when digital image/graphics processor 71 sends a messageinterrupt to the digital image/graphics processor. In a similar fashion,digital image/graphics processor 1 message interrupt flag DIGPlMSG (bit25 of interrupt flag register INTFLG 707) is set when digitalimage/graphics processor 72 sends a message interrupt; digitalimage/graphics processor 2 message interrupt flag DIGP2MSG (bit 26 ofinterrupt flag register INTFLG 707) is set when digital image/graphicsprocessor 73 sends a message interrupt, and digital image/graphicsprocessor 3 message interrupt flag DIGP3MSG (bit 27 of interrupt flagregister INTFLG 707) is set when digital image/graphics processor 74sends a message interrupt. As previously stated, bits 31-28 of interruptflag register INTFLG 707 are reserved for message interrupts from fouradditional digital image/graphics processors in an implementation ofmultiprocessor integrated circuit 100 including eight digitalimage/graphics processors.

When an enabled interrupt occurs, an interrupt pseudo-instruction unit770, which may be a small state machine, injects the following a set ofpseudo-instructions into the pipeline at instruction register-addressstage 751: ##EQU6## These pseudo-instructions are referred to as PS1,PS2, PS3, PS4 and PS5, respectively. Instruction pointer-return fromsubroutine IPRS 704 is not saved by this sequence. If an interruptservice routine performs any branches then instruction pointer-returnfrom subroutine IPRS 704 should first be pushed by the interrupt serviceroutine, and then restored before returning. Note that the vector fetchis a load of the entire program counter PC 701, with instructionpointer-return from subroutine IPRS 704 protected. Since this causes theS, G and L bits of program counter PC 701 to be loaded, the three leastsignificant bits of all interrupt vectors are made "0". One exception tothis statement is that the task vector fetched after a reset should havethe "L" bit (bit 0 of program counter PC 701) set, in order to disablelooping.

The respective addresses of starting points of interrupt serviceroutines for any interrupt represented in the interrupt flag registerINTFLG 707 are called the digital image/graphics processor interruptvectors. These addresses are generated by software and loaded as data tothe parameter memory 25, 30, 35 and 40 corresponding to the respectiveinterrupted digital image/graphics processor 71, 72, 73 and 74 at thefixed addresses shown in Table 34. Interrupt pseudo-instruction PS3takes the 32 bit address stored in the indicated address in thecorresponding parameter memory 25, 30, 35 or 40 and stored this inprogram counter PC 701. Interrupt pseudo-instruction unit 770 computesthe addresses for the corresponding parameter memory based upon thehighest priority interrupt enabled via interrupt enable register 706.Interrupt pseudo-instruction unit 770 operates to include the digitalimage/graphics processor number from communications register COMM 781 inorder to generate unique addresses for each digital image/graphicsprocessor. Note interrupt pseudo-instruction PS4 and PS5 are in thedelay slots following this branch to the interrupt service routine.

                  TABLE 34                                                        ______________________________________                                        INTFLG                                                                          bit Interrupt Name Address                                                  ______________________________________                                        31       Reserved for DIGP7 Message                                                                         0100#1FC                                          30 Reserved for DIGP6 Message 0100#1F8                                        29 Reserved for DIGP5 Message 0100#1F4                                        28 Reserved for DIGP4 Message 0100#1F0                                        27 DIGP3 Message 0100#1EC                                                     26 DIGP2 Message 0100#1E8                                                     25 DIGP1 Message 0100#1E4                                                     24 DIGP0 Message 0100#1E0                                                     23 Spare 0100#1DC                                                             22 Spare 0100#1D8                                                             21 Spare 0100#1D4                                                             20 Master Processor Message 0100#1D0                                          19 Packet Request Successful 0100#1CC                                         18 Packet Request Error 0100#1C8                                              17 Packet Request Busy 0100#1C4                                               16 Spare 0100#1C0                                                             15 Spare 0100#1BC                                                             14 TASK interrupt 0100#1B8                                                    13 Spare 0100#1B4                                                             12 Spare 0100#1B0                                                             11 XY Patching 0100#1AC                                                       10 Reserved 0100#1A8                                                          9 Reserved 0100#1A4                                                           8 Reserved 0100#1A0                                                           7 Reserved 0100#19C                                                           6 Reserved 0100#198                                                           5 Reserved 0100#194                                                           4 Reserved 0100#190                                                           3 Reserved 0100#18C                                                           2 Spare 0100#188                                                              1 Spare 0100#184                                                              0 Emulation 0100#180                                                        ______________________________________                                    

In each address the "#" is replaced by the digital image/graphicsprocessor number obtained from communications register COMM 781.

The final 4 instructions of an interrupt service routine should containthe following (32 bit data, unshifted-index) operations:

    SR=*(A14 ++=4)

    BR=*(A14 ++=7)

    BR=*(A14 ++=5)

    BR=*(A14 ++=5)

These instructions are referred to as RETI1, RETI2, RETI3 and RETI4,respectively, Other operations can be coded in parallel with these ifdesired, but none of these operations should modify status register 211.

The interrupt state can be saved if a new task is to be executed on thedigital image/graphics processor, and then restored to the originalstate after finishing the new task. The write mode controlled by the "W"bit on interrupt enable register INTEN 706 allows this to be donewithout missing any interrupts during the saving or restoringoperations. This may be achieved by the following instruction sequence.First, disable interrupts via a DINT instruction. Next save bothinterrupt enable register INTEN 706 and interrupt flag register INTFLG707. Set the "W" bit (bit 0) of interrupt enable register INTEN 706 to"0" and then write Hex "FFFFFFFF" to interrupt flag register INTFLG 707.Run the new task, which may include enabling interrupts. Followingcompletion of the new task, recover the original task. First, disableinterrupts via the DINT instruction. Set the "W" bit of interrupt enableregister INTEN 706 to "1". Restore the status of interrupt flag registerINTFLG 707 from memory. Next, restore the status of interrupt enableregister INTEN from memory. Last, enable interrupts via the EINTinstruction.

Each digital image/graphics processor 71, 72, 73 and 74 may transmitcommand words to other digital image/graphics processors and to masterprocessor 60. A register to register move with a destination of registerA15, the zero value address register of the global address unit,initiates a command word transfer to a designated processor. Note thatthis register to register transfer can be combined in a singleinstruction with operations of data unit 110 and an access via localdata port 144, as will be described below. This command word istransmitted to crossbar 50 via global data port 148 accompanied by aspecial command word signal. This allows master processor 60 and digitalimage/graphics processors 71, 72, 73 and 74 to communicate with theother processors of multiprocessor integrated circuit 100.

FIG. 41 illustrates schematically the field definitions of these commandwords. In the preferred embodiment command words have the same 32 bitlength as data transmitted via global data port 148. The leastsignificant bits of each command word define the one or more processorsand other circuits to which the command word is addressed. Eachrecipient circuit responds to a received command word only if these bitsindicate the command word is directed to that circuit. Bits 3-0 of eachcommand word designate digital image/graphics processors 74, 73, 72 and71, respectively. Bits 7-4 are not used in the preferred embodiment, butare reserved for use in a multiprocessor integrated circuit 100 havingeight digital image/graphics processors. Bit 8 indicates the commandword is addressed to master processor 60. Bit 9 indicates the commandword is directed to transfer controller 80. Bit 10 indicates the commandword is directed to frame controller 90. Note that not all circuits arepermitted to send all command words to all other circuits. For example,system level command words cannot be sent from a digital image/graphicsprocessor to another digital image/graphics processor or to masterprocessor 60. Only master processor 60 can send command words totransfer controller 80 or to frame controller 90. The limitations onwhich circuit can send which command words to which other circuits willbe explained below in conjunction with the description of each commandword field.

The "R" bit (bit 31) of the command word is a reset bit. Masterprocessor 60 may issue this command word to any digital image/graphicsprocessor, or a digital image/graphics processor may issue this commandword to itself. No digital image/graphics processor may reset anotherdigital image/graphics processor. Note throughout the followingdescription of the reset sequence each digit "#" within an addressshould be replaced with the digital image/graphics processor number,which is stored in bits 1-0 of command register COMM 781. When adesignated digital image/graphics processor receives a reset commandword, it first sets its halt latch and sends a reset request signal totransfer controller 80. Transfer controller 80 sends a reset acknowledgesignal to the digital image/graphics processor. The resetting digitalimage/graphics processor performs no further action until receipt ofthis reset acknowledge signal from transfer processor 80. Upon receiptof the reset acknowledge signal, the digital image/graphics processorinitiates the following sequence of operations: sets the halt latch ifnot already set; clears to "0" the "F", "P", "Q" and "S" bits ofcommunications register COMM 781 (the use of these bits will bedescribed below); clears any pending memory accesses by address unit120; resets any instruction cache service requests; loads intoinstruction register-execute stage IRE 752 the instruction

    BR=[u.ncvz] A14<<1 ˜A14=Hex "0100#7F0"

which unconditionally loads the contents of the stack pointer A14 leftshifted one bit to program counter PC 701 with the negative, carry,overflow and zero status bits protected from change and with the "R" bitset to reset stack pointer A14 in parallel with a load of the stackpointer A14; loads into instruction register-address stage IRA 751 theinstruction

    *(PBA+Hex "FC")=PC

which instruction stores the contents of program counter PC 701 at theaddress indicated by the sum of the address PBA and Hex "FC"; setsinterrupt pseudo-instruction unit 770 to next load interruptpseudo-instruction PS3; sets bit 14 of interrupt flag register INTFLG707 indicating a task interrupt; clears bit 0 of interrupt flag registerINTFLG 707 thus clearing the emulator trap interrupt ETRAP; and clearsbits 11, 7 and 3 of loop control register LCTL thus disabling all threeloops.

Execution by the digital image/graphics processor begins when masterprocessor 60 transmits an unhalt command word. Once execution begins thedigital image/graphics processor: save address stored in program counterPC 701 to address Hex "0100#7FC", this saves the prior contents of stackpointer A14 left-shifted by one place and the current value of thecontrol bits (bits 2-0) of program counter PC 701; loads the address Hex"0100#7F0" into stack pointer A14; loads program counter PC 701 with thetask interrupt vector, where control bits 2-0 are "000"; stores thecontents of instruction register-address stage IPA 751 including controlbits 2-0 at address Hex "0100#7F8"; stores the contents of instructionregister-execute stage IPE including control bits 2-0 at address Hex"0100#7F4"; and begins program execution at the address given by theTask interrupt. The stack-state following reset is shown in Table

                  TABLE 35                                                        ______________________________________                                        Address        Contents                                                       ______________________________________                                        Hex "0100#7FC" stack pointer register A14 from                                   before reset left shifted one place                                          Hex "0100#7F8" instruction register-address stage IRA                          from before reset                                                            Hex "0100#7F4" instruction register-execute stage IRE                          from before reset                                                          ______________________________________                                    

The prior states of instruction register-address stage IRA 751 andinstruction register-execute stage IRE 752 include the control bits 2-0.Note that stack pointer A14 now contains the address Hex "0100#7F0".

The "H" bit (bit 30) of the command word is a halt bit. Master processor60 may issue this command word to any digital image/graphics processor,or a digital image/graphics processor may issue this command word toitself. No digital image/graphics processor may halt another digitalimage/graphics processor. When a designated digital image/graphicsprocessor receives this command word, the digital image/graphicsprocessor sets a halt latch and stalls the pipeline. The digitalimage/graphics processor after that behaves as if in an infinitecrossbar memory contention. Nothing is reset and no interrupts occur orare recognized. Note that when a digital image/graphics processor haltsitself by sending a command word, the two instructions following theinstruction sending the halt command word are in its instructionpipeline. Note that the address pipeline stage of the first instructionfollowing an instruction issuing a halt command word will have alreadyexecuted its address pipeline stage due to the nature of the instructionpipeline. This halt state can only be reversed by receiving an unhaltcommand word from master processor 60.

The Halt condition reduces power consumption within the digitalimage/graphics processor because its state is unchanging. Furtherreduced power may be achieved by stopping the clocks while the digitalimage/graphics processor is in this mode.

The "U" bit (bit 29) of the command word is an unhalt bit. This commandword can only be issued by master processor 60 to one or more of digitalimage/graphics processors 71, 72, 73 and 74. An unhalt command wordclears halt latch of the destination digital image/graphics processor.The digital image/graphics processor then recommences code executionfollowing a halt as if nothing had happened. This is the preferable wayto start a digital image/graphics processor following a hardware orcommand word reset. Upon execution of an unhalt command word, thedestination digital image/graphics processor begins code execution atthe address given by its task interrupt vector. The "U" bit takespriority over the "H" bit of a single command word. Thus receipt of asingle command word with both the "H" bit and the "U" bit set results inexecution of the unhalt command. Note that simultaneously receipt of anunhalt command word from master processor 60 and a halt command wordtransmitted by the digital image/graphics processor itself grantspriority to the master processor 60 unhalt command word. The "R" bittakes priority over the "U" bit. Thus receipt of a single command wordfrom master processor 60 having both the "R" bit and the "U" bit setresults in the digital image/graphics processor reset to the haltedcondition.

The "I" bit (bit 28) of the command word is an instruction cache flushbit. Master processor 60 may issue this command word to any digitalimage/graphics processor, or a digital image/graphics processor mayissue such a command word to itself. No digital image/graphics processormay order an instruction cache flush by another digital image/graphicsprocessor. A designated digital image/graphics processor receiving thiscommand word flushes its instruction cache. An instruction cache flushcauses the cache tag value field to be set to the cache tag register'sown number, clears all their present bits, and sets the LRU bits to thetag register's own number.

The "D" bit (bit 27) of the command word indicates a data cache flush.Digital image/graphics processors 71, 72, 73 and 74 do not employ datacaches, therefore this command word does not apply to digitalimage/graphics processors and is ignored by them. Master processor 60may send this command word to itself to flush its data cache memories 13and 14.

The "K" bit (bit 14) of the command word indicates a task interrupt.Master processor 60 may send this command word to any digitalimage/graphics processor 71, 72, 73 or 74, but no digital image/graphicsprocessor may send this command word to another digital image/graphicsprocessor or to master processor 60. Upon receipt of a task commandword, any digital image/graphics processor designated in the commandword takes a task interrupt if enabled by bit 14 of interrupt enableregister INTEN 706.

The "G" bit (bit 13) of the command word indicates a message interrupt.Any digital image/graphics processor may send this message interrupt toany other digital image/graphics processor or to master processor 60.Any digital image/graphics processor designated in such a command wordwill set its message interrupt flag, and take a message interrupt ifmessage interrupts are enabled via bit 20 of interrupt enable registerINTEN 706. In the preferred embodiment this command word is not sent totransfer controller 80.

When a digital image/graphics processor issues a command word to itself,to halt itself via the "H" bit or flush its instruction cache via the"I" bit, this command word should have the corresponding digitalimage/graphics processor designator bit set, to execute the command.This is for consistency, and to allow future expansion of command wordfunctions.

FIG. 42 illustrates schematically the field definitions ofcommunications register COMM 781. The "F", "S", "Q" and "P" bits (bits31-28) are employed in communication of packet requests from a digitalimage/graphics processor 71, 72, 73 or 74 and transfer controller 80.The "F" and "S" bits are normal read/write bits. The "P" bit may bewritten to only if the "S" bit is "0" or is being simultaneously clearedto "0". The "Q" bit is read only. Packet requests are requests by adigital image/graphics processor 71, 72, 73 or 74 for data movement bytransfer controller 80. These data movements may involve only memories11-14 and 21-40 internal to multiprocessor integrated circuit 100 or mayinvolve both internal memory and external memory. Packet requests arestored as a linked-list structure and only a single packet request maybe active at a time for each digital image/graphics processor. Alinked-list pointer at a dedicated address within the parameter memory25, 30, 35 or 40 corresponding to the requesting digital image/graphicsprocessor 71, 72, 73 or 74 points to the beginning of the activelinked-list. Each entry in the linked-list contains a pointer to thenext list entry.

Initializing a packet request involves the following steps. First, thedigital image/graphics processor sets the desired packet requestparameters into its corresponding parameter memory. Next, the digitalimage/graphics processor stores the address of the first link of thelinked-list at the predetermined address Hex "0100#0FC" in itscorresponding parameter memory, where "#" is replaced with the digitalimage/graphics processor number. Setting the "P" bit (bit 28) ofcommunications register COMM 781 to "1" alerts transfer controller 80 ofthe packet request. The digital image/graphics processor may request ahigh priority by setting the "F" bit (bit 31) to "1" or a low priorityby clearing the "F" bit "0".

Transfer controller 80 recognizes when the "P" bit is set and assigns apriority to the packet request based upon the state of the "F" bit.Transfer controller 80 clears the "P" bit and sets the "Q" bit,indicating that a packet request is in queue. Transfer controller 80then accesses the predetermined address Hex "1000#0FC" within thecorresponding parameter memory and services the packet request basedupon the linked-list. Upon completion of the packet request, transfercontroller 80 clears the "Q" bit to "0" indicating that the queue is nolonger active. The digital image/graphics processor may periodicallyread this bit for an indication that the packet request is complete.Alternatively, the packet request itself may instruct transfercontroller 80 to interrupt the requesting digital image/graphicsprocessor when the packet request is complete. In this case, transfercontroller 80 sends an interrupt to the digital image/graphics processorby setting bit 19, the packet request end interrupt bit PREND, ininterrupt flag register INTFLG 707. If transfer controller 80 encountersan error in servicing the packet request, it sends an interrupt to thedigital image/graphics processor by setting bit 18, the packet requesterror interrupt bit PRERROR, in interrupt flag register INTFLG 707. Thedigital image/graphics processor has the appropriate interrupt vectorsstored at the locations noted in Table 34 and the appropriate interruptservice routines.

The digital image/graphics processor may request another packet whiletransfer controller 80 is servicing a prior request. In this event thedigital image/graphics processor sets the "P" bit to "1" while the "Q"bit is "1". If this occurs, transfer controller 80 sends a packetrequest busy interrupt PRB to the digital image/graphics processor bysetting bit 17 of interrupt flag register INTFLG 707. Transfercontroller 80 then clears the "P" bit to "0". The interrupt serviceroutine of requesting digital image/graphics processor may suspend thesecond packet request while the first packet request is in queue, cancelthe packet request or take some other corrective action. This featurepermits the digital image/graphics processor to submit packet requestswithout first checking the "Q" bit of communications register COMM 781.

The digital image/graphics processor may suspend service of the packetrequest by setting the "S" bit to "1". Transfer controller 80 detectswhen the "S" bit is "1". If this occurs while a packet request is inqueue, the transfer controller copies the "Q" bit into the "P" bit andclears the "Q" bit. This will generally set the "P" bit to "1". Softwarewithin the requesting digital image/graphics processor may then changethe status of the "S" and "P" bits. Transfer controller 80 retains inmemory its location within the linked-list of the suspended packetrequest. If transfer controller 80 determines that the "S" bit is "0"and the "P" bit is simultaneously "1", then the suspended packet requestis resumed.

The "Sync bits" field (bits 15-8) of communications register COMM 781are used in a synchronized multiple instruction, multiple data mode.This operates for any instructions bounded by a lock instruction LCK,which enables the synchronized multiple instruction, multiple data mode,and an unlock instruction UNLCK, which disables this mode. Bits 11-8indicate whether instruction fetching is to be synchronized with digitalimage/graphics processors 74, 73, 72 and 71, respectively. A "1" in anyof these bits indicates the digital image/graphics processor delaysinstruction fetch until the corresponding digital image/graphicsprocessor indicates it has completed execution of the prior instruction.The other digital image/graphics processors to which this digitalimage/graphics processor is to be synchronized will similarly have setthe corresponding bits in their communication register COMM 781. It isnot necessary that the "Sync bit" corresponding to itself be set when adigital image/graphics processor is in the synchronized multipleinstruction, multiple data mode, but this does no harm. Note that bits15-12 are reserved for a possible extension to eight digitalimage/graphics processors.

The "DIGP#" field (bits 2-0) of communications register COMM 781 areunique to each particular digital image/graphics processor onmultiprocessor integrated circuit 100. These bits are read only, and anyattempt to write to these bits fails. This is the only part of thedigital image/graphics processors 71, 72, 73 and 74 that is notidentical. Bits 1-0 are hardwired to a two bit code that identifies theparticular digital image/graphics processor as shown in Table

                  TABLE 36                                                        ______________________________________                                               COMM                                                                     field Parallel                                                                1 0 Processor                                                               ______________________________________                                               0 0   DIGP0 (71)                                                         0 1 DIGP1 (72)                                                                1 0 DIGP2 (73)                                                                1 1 DIGP3 (74)                                                              ______________________________________                                    

Note that bit 2 is reserved for future use in a multiprocessorintegrated circuit 100 having eight digital image/graphics processors.In the current preferred embodiment this bit is hardwired to "0" for allfour digital image/graphics processors 71, 72, 73 and 74.

This part of communications register COMM 781 serves to identify theparticular digital image/graphics processor. The identity number of adigital image/graphics processor may be extracted by ANDingcommunications register COMM 781 with 7 (Hex "0000007"). The instruction"D0=COMM&7" does this for example. This instruction returns only thedata in bits 2-0 of communications register COMM 781. Note that thisinstruction is suitable for embodiments having eight digitalimage/graphics processors. Since the addresses of the data memories andparameter memories corresponding to each digital image/graphicsprocessor depend on the identity of that digital image/graphicsprocessor, the identity number permits software to compute the addressesfor these corresponding memories. Using this identity number makes it ispossible to write software that is independent of the particular digitalimage/graphics processor executing the program. Note that digitalimage/graphics processor independent programs may also use registers PBAand DBA for the corresponding parameter memory base address and datamemory base address.

Table 37 lists the coding of registers called the lower 64 registers.Instruction words refer to registers by a combination of register bankand register number. If no register bank designation is permitted inthat instruction word format, then the register number refers to one ofthe data registers 200 D7-D0. Some instruction words include 3 bitregister bank fields. For those instructions words the register islimited to the lower 64 registers listed in Table 37, with a leading "0"implied in the designated register bank. Otherwise, the instruction wordrefers to a register by a four bit register bank and a three bitregister number.

                  TABLE 37                                                        ______________________________________                                        Reg.   Reg.     Register                                                                              Reg.    Reg. Register                                   Bank No. Name Bank No. Name                                                 ______________________________________                                        0000   000      A0      0100    000  D0                                         0000 001 A1 0100 001 D1                                                       0000 010 A2 0100 010 D2                                                       0000 011 A3 0100 011 D3                                                       0000 100 reserved 0100 100 D4                                                 0000 101 reserved 0100 101 D5                                                 0000 110 A6 0100 110 D6                                                       0000 111 A7 0100 111 D7                                                       0001 000 A8 0101 000 ROT                                                      0001 001 A9 0101 001 SR                                                       0001 010 A10 0101 010 MF                                                      0001 011 A11 0101 011 reserved                                                0001 100 reserved 0101 100 reserved                                           0001 101 reserved 0101 101 reserved                                           0001 110 A14 0101 110 reserved                                                0001 111 A15 0101 111 reserved                                                0010 000 X0 0110 000 GLMUX                                                    0010 001 X1 0110 001 reserved                                                 0010 010 X2 0110 010 reserved                                                 0010 011 X3 0110 011 reserved                                                 0010 100 reserved 0110 100 reserved                                           0010 101 reserved 0110 101 reserved                                           0010 110 reserved 0110 110 reserved                                           0010 111 reserved 0110 111 reserved                                           0011 000 X8 0111 000 PC/CALL                                                  0011 001 X9 0111 001 IPA/BR                                                   0011 010 X10 0111 010 IPE                                                     0011 011 X11 0111 011 IPRS                                                    0011 100 reserved 0111 100 INTEN                                              0011 101 reserved 0111 101 INTFLG                                             0011 110 reserved 0111 110 COMM                                               0011 111 reserved 0111 111 LCTL                                             ______________________________________                                    

Registers A0 through A15 are address unit base address registers 611.Registers X0 through X15 are address unit index address registers 612.Registers D0 through D7 are data unit data registers 200. Register ROTis the rotation data register 208. Register SR is the data unit statusregister 210. Register MF is the data unit multiple flags register 211.Register GLMUX is the address unit global/local address multiplexregister 630. Register PC is the program flow control unit 130 programcounter PC 701 that points to the instruction being fetched. Readingfrom this register address obtains the address of the next instructionto be fetched. Writing to this register address causes a software call(CALL). This changes the next instruction pointed to by program counterPC 701 and loads the previous contents of program counter PC 701 intoinstruction pointer-return from subroutine IPRS 704. Register IPA is theprogram flow control unit instruction pointer-address stage 702, whichholds the address of the instruction currently controlling the addresspipeline stage. Reading from this register address obtains the addressof the instruction currently in the address pipeline stage. Writing tothis register address executes a software branch (BR). This alters theaddress stored in program counter PC 701 without changing the addressstored in either instruction pointer-address stage IPA 702 orinstruction pointer-return from subroutine IPRS 704. Register IPE is theprogram flow control unit instruction pointer-execute stage 703, whichholds the address of the instruction currently controlling the executepipeline stage. Software would not ordinarily write to either of thesetwo registers. Register IPRS is the program flow control unitinstruction pointer-return from subroutine 704. Instructionpointer-return from subroutine IPRS 704 is loaded with the value ofprogram counter PC 701 incremented in bit 3 upon every write to programcounter PC 701. This provides a return address for a subroutine call asthe next sequential instruction. Register INTEN is the program flowcontrol unit interrupt enable register 706 that controls the enablingand disabling of various interrupt sources. Register INTFLG is theprogram flow control unit interrupt flag register 707. This registercontains bits representative of the interrupt sources that are set uponreceipt of a corresponding interrupt. Register COMM is the program flowcontrol unit 130 communications register 781. This register controlspacket requests by the digital image/graphics processor to the transfercontroller 80, synchronization between digital image/graphics processorsduring synchronized MIMD operation and includes hardwired bitsidentifying the digital image/graphics processor. Register LCTL is theprogram flow control unit loop control register 705, which controlswhether hardware loop operations are enabled and which loop counter todecrement.

Table 38 lists the coding of registers called the upper 64 registers.These registers have register banks in the form "1XXX".

                  TABLE 38                                                        ______________________________________                                        Reg.   Reg.     Register    Reg. Reg.   Register                                Bank No. Name Bank No. Name                                                 ______________________________________                                        1000   000      reserved    1100 000    LC0                                     1000 001 reserved 1100 001 LC1                                                1000 010 reserved 1100 010 LC2                                                1000 011 reserved 1100 011 reserved                                           1000 100 reserved 1100 100 LR0                                                1000 101 reserved 1100 101 LR1                                                1000 110 reserved 1100 110 LR3                                                1000 111 reserved 1100 111 reserved                                           1001 000 reserved 1101 000 LRSE0                                              1001 001 reserved 1101 001 LRSE1                                              1001 010 reserved 1101 010 LRSE2                                              1001 011 reserved 1101 011 reserved                                           1001 100 reserved 1101 100 LRS0                                               1001 101 reserved 1101 101 LRS1                                               1001 110 reserved 1101 110 LRS2                                               1001 111 reserved 1101 111 reserved                                           1010 000 ANACNTL 1110 000 LS0                                                 1010 001 ECOMCNTL 1110 001 LS1                                                1010 010 ANASTAT 1110 010 LS2                                                 1010 011 EVTCNTR 1110 011 reserved                                            1010 100 CNTCNTL 1110 100 LE0                                                 1010 101 ECOMCMD 1110 101 LE1                                                 1010 110 ECOMDATA 1110 110 LE2                                                1010 111 BRK1 1110 111 reserved                                               1011 000 BRK2 1111 000 CACHE                                                  1011 001 TRACE1 1111 001 GTA                                                  1011 010 TRACE2 1111 010 reserved                                             1011 011 TRACE3 1111 011 reserved                                             1011 100 reserved 1111 100 TAG0                                               1011 101 reserved 1111 101 TAG1                                               1011 110 reserved 1111 110 TAG2                                               1011 111 reserved 1111 111 TAG3                                             ______________________________________                                    

In Table 38 the registers ANACNTL, ECOMCNTL, ANASTAT, EVTCNTR, CNTCNTL,ECOMCMD, ECOMDATA, BRK1, BRK2, TRACE1, TRACE2 and TRACE3 are used withan on chip emulation technique. These registers form no part of thepresent invention and will not be further described. The registers LC0,LC1 and LC2 are loop count registers 733, 732 and 731, respectively,within the program flow control unit 130 that are assigned to store thecurrent loop count for hardware loops. The registers LR0, LR1 and LR2are program flow control unit 130 loop reload registers 743, 742 and741, respectively. These registers store reload values for thecorresponding loop count registers LC0, LC1 and LC2 permitting nestedloops. The register addresses corresponding to LRSEO, LRSE1, LRSE2,LRS0, LRS1 and LRS2 are write only addresses used for fast loopinitialization. Any attempt to read from these register addressesreturns null data. Writing a count into one of registers LRS0, LRS1 orLRS2 writes the same count into corresponding loop count register andloop reload register; writes the address stored in program counter PC701 incremented in bit 3 into the corresponding loop start addressregister; and writes to loop control register LCTL 705 to enable thecorresponding hardware loop. These registers enable fast initializationof a multi-instruction loop. Writing a count into one of registersLRSEO, LRSE1 or LRSE2: writes the same count into corresponding loopcount register and loop reload register; writes the address stored inprogram counter PC 701 incremented in bit 3 into the corresponding loopstart address register and loop end address register; and writes to loopcontrol register LCTL 705 to enable the corresponding hardware loop.These registers enable fast initialization of a loop of a singleinstruction. The registers LS0, LS1 and LS2 are loop start addressregisters 723, 722 and 721, respectively, for corresponding hardwareloops. The registers LE0, LE1 and LE2 are loop end address registers713, 712 and 711, respectively, for corresponding hardware loops.Register CACHE is register 709 that mirrors the digital image/graphicsprocessor instruction cache coding. Register GTA is the global temporaryregister 108 that stores the results of the global address unitoperation for later reuse upon contention or pipeline stall. Thisregister is read only and an attempt to write to this register isignored. Registers TAG3, TAG2, TAG1 and TAG0 are cache tag registersdesignated collectively as 708, which store the relevant addressportions of data within the data cache memory corresponding to thatdigital image/graphics processor.

FIG. 43 illustrates the format of the instruction word for digitalimage/graphics processors 71, 72, 73 and 74. The instruction word has 64bits, which are generally divided into two parallel sections asillustrated in FIG. 43. The most significant 25 bits of the instructionword (bits 63-39) specify the type of operation performed by data unit110. The least significant 39 bits of the instruction word (bits 38-0)specify data transfers performed in parallel with the operation of dataunit 110. There are five formats A, B, C, D and E for operation of dataunit 110. There are ten types of data transfer formats 1 to 10. Theinstruction word may specify a 32 bit immediate value as an alternativeto specifying data transfers. The instruction word is not divided intothe two sections noted above when specifying a 32 bit immediate value,this being the exception to the general rule. Many instructions performoperations that do not use data unit 110. These instructions may allowparallel data transfer operations or parallel data transfer operationsmay be prohibited depending on the instruction. In other respects theoperations specified for data unit 110 are independent of the operationsspecified for data transfer.

The instruction word alternatives are summarized as follows. Theoperation of data unit 110 may be a single arithmetic logic unitoperation or a single multiply operation, or one of each can beperformed in parallel. All operations of data unit 110 may be madeconditional based upon a field in the instruction word. The paralleldata transfers are performed on local port 141 and global port 145 ofdata port unit 140 to and/or from memory. Two data transfer operationsare independently specified within the instruction word. Twelveaddressing modes are supported for each memory access, with a choice ofregister or offset index. An internal register to register transferwithin data unit 110 can be specified in the instruction word instead ofa memory access via global port 145. When an operation of data unit 110uses a non-data unit register as a source or destination, then some ofthe parallel data transfer section of the instruction word specifiesadditional register information, and the global port source data busGsrc 105 and global port destination data bus Gdst 107 transfer the datato and from data unit 110.

A part of the instruction word that normally specifies the local busdata transfer has an alternative use. This alternative use allowsconditional data unit 110 operation and/or global memory access or aregister to register move. Limited conditional source selection issupported in the operation of data unit 110. The result of data unit 110can be conditionally saved or discarded, advantageously conditionallyperforming an operation without having to branch. Update of eachindividual bit of a status register can also be conditionally selected.Conditional stores to memory choose between two registers. Conditionalloads from memory either load or discard the data. Conditional registerto register moves either write to the destination, or discard the data.

Description of the types of instruction words of FIG. 43 and anexplanation or glossary of various bits and fields of the five data unitoperation formats follows. The bits and fields define not only theinstruction words but also the circuitry that decodes the instructionwords according to the specified logic relationships. This circuitryresponds to a particular bit or field or logical combination of theinstruction words to perform the particular operation or operationsrepresented. Accordingly, in this art the specification of bits, fields,formats and operations defines important and advantageous features ofthe preferred embodiment and specifies corresponding logic circuitry todecode or implement the instruction words. This circuitry is straightforwardly implemented from this specification by the skilled worker in aprogrammable logic array (PLA) or in other circuit forms now known orhereafter devised. A description of the legal operation combinationsfollows the description of the instruction word format.

Data unit format A is recognized by bit 63="1" and bit 44="0". Data unitformat A specifies a basic arithmetic logic unit operation with a 5 bitimmediate field. The "class" field (bits 62-60) designates the datarouting within data unit 110 with respect to arithmetic logic unit 230.Table 39 shows the definition of the data routings corresponding to the"class" field for data unit formats A, B and C.

                  TABLE 39                                                        ______________________________________                                        Class                                                                           field                                                                         6 6 6                                                                         2 1 0 Input A Input B Input C maskgen rotate                                ______________________________________                                        0 0 0   src2/im src1      @MF   --       0                                      0 0 1 dstc src1 src2/im -- D0(4-0)                                            0 1 0 dstc src1 mask src2/im 0                                                0 1 1 dstc src1 mask src2/im src2/im                                          1 0 0 src2/im src1 mask D0(4-0) D0(4-0)                                       1 0 1 src2/im src1 @MF - D0(4-0)                                              1 1 0 dstc src1 src2/im - 0                                                   1 1 1 srcl Hex "1" src2/im - src2/im                                        ______________________________________                                    

In Table 39 "Input A" is the source selected by Amux 232 for input A bus241. The source "src2/im" is either the five bit immediate value of"immed" field (bits 43-39) in data unit format A, the data register 200designated by the "src2" field (bits 41-39) in data unit format B, orthe 32 bit immediate value of the "32-bit immediate" field (bits 31-0)in data unit format C. The source "dstc" is a companion data register200 to the destination of the arithmetic logic unit 230 result. Thiscompanion data register 200 has a register designation with the upperfour bits equal to "0110", thereby specifying one of data registers 200,and a lower three bits specified by the "dst" field (bits 50-48).Companion registers are used with transfer formats 6 and 10 which use an"Adstbnk" field (bits 21-18) to specify the register bank of thedestination and an "As1bank" (bits 9-6) to specify the register bank ofInput B. This is known as a long distance destination, because thedestination is not one of data registers 200. Thus one source and thedestination may have different register banks with the same registernumbers. Table 40 shows the companion registers to various other digitalimage/graphics processor registers based upon the register bankspecified in the "Adstbnk" field. Note that with any other transferformats this source register is the data register 200 having theregister number specified by the "dst" field.

                                      TABLE 40                                    __________________________________________________________________________    Companion Data Registers                                                      Adstbnk                                                                            D0  D1  D2  D3  D4  D5   D6  D7                                          __________________________________________________________________________    0 0 0 0                                                                            A0  A1  A2  A3  A4  --   A6  A7                                            0 0 0 1 A8 A9 A10 A11 A12 -- A14 A15                                          0 0 1 0 X0 X1 X2 -- -- -- -- --                                               0 0 1 1 X8 X9 X10 -- -- -- -- --                                              0 1 0 0 D0 D1 D2 D3 D4 D5 D6 D7                                               0 1 0 1 -- SR MF -- -- -- -- --                                               0 1 1 1 CALL BR IPS IPRS INTEN INTFLG COMM LCTL                               1 1 0 0 LC0 LC1 LC2 -- LR0 LR1 LR2 --                                         1 1 0 1 LRSE0 LRSE1 LRSE2 -- LRS0 LRS1 LRS2 --                                1 1 1 0 LS0 LS1 LS2 -- LE0 LE1 LE2 --                                         1 1 1 1 -- -- -- -- TAG0 TAG1 TAG2 TAG3                                     __________________________________________________________________________

In Table 40 "--" indicates a reserved register. Note that Table 40 doesnot list register banks "0110, "1000", "1001", "1010" or "1011". All theregisters in these banks are either reserved or assigned to emulationfunctions and would not ordinarily be used as long distancedestinations.

In Table 39 "Input B" is the source for barrel rotator 235 whichsupplies input B bus 242. The "Input B" source designated "src1" is thedata register 200 indicated by the "src1" field (bits 47-45) in dataunit formats A and B, or by the register bank of the "s1bank" field(bits 38-36) and the register number of the "src1" field (bits 48-45),which may be any of the 64 lower addressable registers within data unit110 listed in Table 37, in data format C. The "Hex 1" source for "InputB" is the 32 bit constant equal to "1" from buffer 236, In Table 39"Input C" is the source selected by Cmux 233 for input C bus 243.

The "Input C" source "@MF" is one or more bits from multiple flagsregister 211 as expanded by expand circuit 238 in accordance with the"Msize" field (bits 5-3) of status register 210. See Table 2 for thedefinition of the "Msize" field of status register 210. The "src2/im"source has been previously described in conjunction with the "Input A"source. The "mask" source is the output of mask generator 239. In Table39 "maskgen" is the source selected by Mmux 234 for mask generator 239.This source may be "src2/im" as previously described or "D0(4-0)", whichis the default barrel rotate amount of the "DBR" field (bits 4-0) ofdata register D0. In Table 39 "rotate" is the source selected by Smux231 for control of the rotate amount of barrel rotator 235. This sourcemay be "0", which provides no rotate, "D0(4-0)", which is the defaultbarrel rotate amount of the "DBR" field (bits 4-0) of data register D0,or "src2/im" as previously described.

The "ari" bit (bit 59) designates whether arithmetic logic unit 230 ofdata unit 110 is used for an arithmetic operation or for a Boolean logicoperation. If the "ari" bit is "1" then an arithmetic operation occurs,if "0" then a Boolean logic operation occurs.

Data unit format A permits instruction word specification of theoperation of arithmetic logic unit 230. The "8-bit ALU code" field (bits58-51) designates the operation performed by arithmetic logic unit 230.This field designates an arithmetic operation if the "ari" bit is "1".If this is the case then "8-bit ALU code" bits 57, 55, 53 and 51designate the arithmetic operation according to Table 21 as modified bythe "FMOD" field consisting of "8-bit ALU code" bits 58, 56, 54 and 52according to Table 6. If the "ari" bit is "0", then this is a Booleanoperation and the "8-bit ALU code" field translates into functionsignals F7-F0 according to Table 20. The details of these encodings weredescribed above in conjunction with the description of data unit 110.

Data unit format A designates two sources and a destination forarithmetic logic unit 230. The "dst" field (bits 50-48) designates aregister as the destination for arithmetic logic unit 230. The "dst"field may refer to one of data registers 200 by register number or theregister number of the "dst" field may be used in conjunction with aregister bank to specify a long distance register depending on thetransfer format. The "src1" field (bits 47-45) designate a register asthe first source for arithmetic logic unit 230. This may be one of dataregisters 200 or may be used in conjunction with a register bank tospecify a long distance register depending on the transfer format. The"immed" field (bits 43-39) designates a 5 bit immediate value used asthe second source for arithmetic logic unit 230. In use this 5 bitimmediate value is zero extended to 32 bits. The use of register bankswill be further discussed below in conjunction with description of thetransfer formats.

The storing of the resultant in the destination register occurs only ifthe condition noted in the "cond." field is true. The "cond." field(bits 35-32) designates the conditions for a conditional operation. Notethat this "cond." field falls within the portion of the instruction wordgenerally used for the transfer format. Transfer formats 7, 8, 9 and 10include this field. Thus conditional storing of the resultant ofarithmetic logic unit 230 occurs only when these transfer formats areused. In the preferred embodiment the "cond." field is decoded as shownbelow in Table

                  TABLE 41                                                        ______________________________________                                        Condition                                                                       field                                                                         bits                                                                          3 3 3 3  Condition Status bits                                                5 4 3 2 Mnemonic Description Compared                                       ______________________________________                                        0 0 0 0 u         unconditional                                                                             --                                                0 0 0 1 p positive ˜N&˜Z                                          0 0 1 0 ls lower than ˜C|Z                                       or same                                                                     0 0 1 1 hi higher than C&˜Z                                             0 1 0 0 lt less than (N&˜V) | (˜N&V)                     0 1 0 1 le less than (N&˜V) | (˜N&V) | Z                                       or equal to                                    0 1 1 0 ge greater than (N&V) | (˜N&˜V)                    or equal to                                                                 0 1 1 1 gt greater than (N&V&˜Z) |                                (˜N&˜V&˜Z)                                               1 0 0 0 hs, c lower than, C                                                     carry                                                                       1 0 0 1 lo, nc higher than or ˜C                                          same, no carry                                                              1 0 1 0 eq, z equal, zero Z                                                   1 0 1 1 ne, nz not equal, ˜Z                                              not zero                                                                    1 1 0 0 v overflow V                                                          1 1 0 1 nv no overflow ˜V                                               1 1 1 0 n negative N                                                          1 1 1 1 nn non-negative ˜N                                            ______________________________________                                    

The conditions are detected with reference to status register 210. Aspreviously described, status register 210 stores several bits related tothe condition of the output of arithmetic logic unit 230. Theseconditions include negative, carry, overflow and zero. The conditionaloperation of arithmetic logic unit 230 related to status register 210was detailed above in conjunction with the description of data unit 110.

The data unit format B is recognized by bit 63="1", bit 44="0". Dataunit format B specifies a basic arithmetic logic unit operation with aregister specified for the second source of arithmetic logic unit 230.The "class" field designates the data routing within data unit 110 aspreviously described in conjunction with Table 39. The "ari" bitdesignates whether arithmetic logic unit 230 of data unit 110 is usedfor an arithmetic operation or for a Boolean logic operation. The "8 bitALU code" field designates the operation performed by arithmetic logicunit 230 in the manner described above. The "src2" field (bits 41-39)designates one of the data registers 200 as the second source forarithmetic logic unit 230. In data unit format B the second source forarithmetic logic unit 230 is the data register designated in the "src2"field. Some data transfer formats permit designation of banks ofregisters for the first source and the destination of arithmetic logicunit 230. In other respects data unit format B is the same as data unitformat A.

The data unit format C is recognized by bit 63="1", bit 44="1" and bit43="1". Data unit format C specifies a basic arithmetic logic unitoperation with a 32 bit immediate field. The "class" field designatesthe data routing within data unit 110 as previously described inconjunction with Table 39. The "ari" bit designates whether arithmeticlogic unit 230 of data unit 110 is used for an arithmetic operation orfor a Boolean logic operation. The "8 bit ALU code" field designates theoperation performed by arithmetic logic unit 230 as described above. Thefirst source is the data register designated by the "src1" field. Thesecond source is the 32 bit immediate value of the "32-bit imm." field(bits 31-0). This data unit format leaves no room to specify paralleldata transfers, so none are permitted. The "dstbank" field (bits 42-39)designates a bank of registers within data unit 110. The "dstbank" fieldis employed with the "dst" field (bits 50-48) to designate any of 64registers of data unit 110 listed in Tables 37 and 38 as the destinationfor arithmetic logic unit 230. The "s1bnk" field (bits 38-36) designatesa bank of registers within data unit 110. This designation is limited toa lower half of the registers of data unit 110 and is employed with the"src1" field to designate any of 64 lower half registers in data unit110 listed in Table 37 as the first source for arithmetic logic unit230. Operations can be made conditional based upon the "cond." field(bits 35-32) in a manner detailed below.

Data unit format D has bit 63="1", bit 44="0", the "class" field is"000", bit 59="1" (which normally selects arithmetic as opposed toBoolean logic operation) and bits 57, 55, 53 and 51 of the "8 bit ALUcode" are all "0". Data unit format D specifies non-arithmetic logicunit operations. The "operation" field (bits 43-39) designates anon-arithmetic logic unit operation. In the preferred embodiment this"operation" field is decoded as shown below in Table

                  TABLE 42                                                        ______________________________________                                        Operation field                                                                 4 4 4 4 3 Non-ALU                                                             3 2 1 0 9 Operation                                                         ______________________________________                                        0 0 0 0 0        no operation                                                   0 0 0 0 1 idle                                                                0 0 0 1 0 enable global interrupts                                            0 0 0 1 1 disable global interrupts                                           0 0 1 0 0 lock synchronization of                                              instruction fetching                                                         0 0 1 0 1 unlock synchronization of                                            instruction fetching                                                         0 0 1 1 0 reserved                                                            0 0 1 1 1 rotate D registers right 1                                          0 1 0 0 0 null                                                                0 1 0 0 1 halt instruction execution                                          0 1 0 1 0 reserved                                                            0 1 0 1 1 reserved                                                            0 1 1 0 0 go to emulator interrupt                                            0 1 1 0 1 issue emulator interrupt 1                                          0 1 1 1 0 issue emulator interrupt 2                                          0 1 1 1 1 reserved                                                            1 X X X X reserved                                                          ______________________________________                                    

The non-arithmetic logic unit instructions null, halt instructionexecution, go to emulator interrupt, issue emulator interrupt 1 andissue emulator interrupt 2 prohibit parallel data transfers. Anyparallel data transfers specified in the instruction word are ignored.The other non-arithmetic logic unit instructions permit parallel datatransfers.

Data unit format E is recognized by bits 63-61 being "011". Data unitformat E specifies parallel arithmetic logic unit and multiplyoperations. These operations are referred to as "six operand operations"because of the six operands specified in this format. In the preferredembodiment the "operation" field (bits 60-57) specifies the operationsshown below in Table 43. The symbol "∥" indicates that the listedoperations occur in parallel within data unit 110. Note that only 11 ofthe 16 possible operations are defined.

                  TABLE 43                                                        ______________________________________                                        Operation field bits                                                          6        5     5         5   Six Operand                                        0 9 8 7 Operations                                                          ______________________________________                                        0        0     0         0   MPYS ∥ ADD                                0 0 0 1 MPYS ∥ SUB                                                   0 0 1 0 MPYS ∥ EALUT                                                 0 0 1 1 MPYS ∥ EALUF                                                 0 1 0 0 MPYU ∥ ADD                                                   0 1 0 1 MPYU ∥ SUB                                                   0 1 1 0 MPYU ∥ EALUT                                                 0 1 1 1 MPYU ∥ EALUF                                                 1 0 0 0 EALU ∥ ROTATE                                                1 0 0 1 EALU % ∥ ROTATE                                              1 0 1 0 DIVI                                                                  1 0 1 1 reserved                                                              1 1 0 0 reserved                                                              1 1 0 1 reserved                                                              1 1 1 0 reserved                                                              1 1 1 1 reserved                                                            ______________________________________                                    

The mnemonics for these operations were defined above. To review:MPYS∥ADD designates a parallel signed multiply and add; MPYS∥SUBdesignates a parallel signed multiply and subtract; MPYS∥EALUTdesignates a parallel signed multiply and extended arithmetic logic unittrue operation; MPYS∥EALUF designates a parallel signed multiply andextended arithmetic logic unit false operation; MPYU∥ADD designates aparallel unsigned multiply and add; MPYU∥SUB designates a parallelunsigned multiply and subtract; MPYU∥EALUT designates a parallelunsigned multiply and extended arithmetic logic unit true operation;MPYU∥EALUF designates a parallel unsigned multiply and extendedarithmetic logic unit false operation; EALU∥ROTATE designates anextended arithmetic logic unit operation with the output of barrelrotator 235 separately stored; EALU%∥ROTATE designates an extendedarithmetic logic unit operation employing a mask generated by maskgenerator 239 with the output of barrel rotator 235 separately stored;and DIVI designates a divide iteration operation used in division. Thearithmetic logic unit operation in an MPYx∥EALUT instruction is selectedby the "EALU" field (bits 19-26) of data register D0, with the "A" bit(bit 27) selecting either an arithmetic operation or a logic operationas modified by the "FMOD" field (bits 31-28). The coding of these fieldshas been described above. The arithmetic logic unit operation in anMPYX∥EALUF instruction is similarly selected except that the sense ofthe "EALU" field bits is inverted. The arithmetic logic unit operationsfor the EALU and EALU% instructions are similarly selected. Theseoperations employ part of the data register D0 of data unit 110 tospecify the arithmetic logic unit operation. Data register D0 ispre-loaded with the desired extended arithmetic logic unit operationcode. The DIVI operation will be further detailed below. Any datatransfer format may be specified in parallel with the operation of dataunit 110.

Six operands are specified in data unit format E. There are four sourcesand two destinations. The "src3" field (bits 56-54) designates one ofthe data registers 200 as the third source. This is the first input formultiplier 220 if a multiply operation is specified, otherwise this isthe barrel rotate amount of barrel rotator 235. The "dst2" field (bits53-51) designates one of the data registers 200 as the seconddestination. If the instruction specifies a multiply operation, then"dst2" is the destination for multiplier 220. Otherwise "dst2" specifiesthe destination for the output of barrel rotator 235. The "dst1" field(bits 50-48) designates one of the data registers 200 as the destinationfor arithmetic logic unit 230. The "src1" field (bits 47-45) designatesa register as the first input for arithmetic logic unit 230. If thisinstruction includes a transfer format 6 or 10, which include an"As1bank" field (bits 9-6), then this register source may be anyregister within data unit 110 with the "As1bank" field designating theregister bank and the "src1" field designating the register number. Insuch a case this data cannot be rotated by barrel rotator 235. This iscalled a long distance arithmetic logic unit operation. For othertransfer formats, the "src1" field specifies one of the data registers200 by register number. Transfer formats 7, 8, 9 and 10 permit theregister source to be conditionally selected from a pair of dataregisters 200 based on the "N" bit of status register 210. If the "N"bit (bit 31) of status register 211 is "1" then the designated dataregister is selected as the first source for arithmetic logic unit 230.If the "N" bit is "0" then the data register one less is selected. Ifthis option is used, then the register number of the "src1" field mustbe odd. The "src2" field (bits 44-42) designates one of the dataregisters 200 as the second input for multiplier 220. The "src2" field(bits 41-39) designates one of the data registers 200 as the secondinput for multiplier 220.

Table 44 shows the data path connections for some of the operationssupported in data unit format E. Input C is the signal supplied to inputC bus 243 selected by multiplexer Cmux 233. Maskgen is the signalsupplied to mask generator 239 selected by multiplexer Mmux 234. Rotateis signal supplied to the control input of barrel rotator 235 selectedby multiplexer Smux 231. Product left shift is the signal supplied tothe control input of product left shifter 224 supplied to the controlinput of product left shifter 224 selected by multiply shift multiplexerMSmux 225. Note that the special case of the DIVI operation will bedescribed later.

                  TABLE 44                                                        ______________________________________                                        Six Operand                          product                                    Operation Input C maskgen rotate left shift                                 ______________________________________                                        MPYS ∥ ADD                                                                      --       --       0       0                                          MPYS ∥ SUB -- -- 0 0                                                 MPYS ∥ EALUT mask D0(4-0) D0(4-0) D0(9-8)                            MPYS ∥ EALUF mask D0(4-0) D0(4-0) D0(9-8)                            MPYU ∥ ADD -- -- 0 0                                                 MPYU ∥ SUB -- -- 0 0                                                 MPYU ∥ EALUT mask D0(4-0) D0(4-0) D0(9-8)                            MPYU ∥ EALUF mask D0(4-0) D0(4-0) D0(9-8)                            EALU src4 -- src3 --                                                          EALU % mask src4 src1 --                                                    ______________________________________                                    

For all the six operand instructions listed in Table 44, the first inputto multiplier 220 on bus 201 is the register designated by the "src3"field (bits 56-54), the second input to multiplier 220 on bus 202 is theregister designated by the "src4" field (bits 44-42), the input tobarrel rotator 235 is the register designated by the "src1" field (bits41-39) and the input to input A bus 241 is the register designated bythe "src2" field (bits 47-45). Also note that multiplier 220 is not usedin the EALU and EALU % instructions, instead the results of barrelrotator 235 are saved in the register designated by the "dst2" field(bits 53-51) via multiplexer Bmux 227.

The DIVI operation uses arithmetic logic unit 230 and does not usemultiplier 220. The DIVI operation may be used in an inner loop forunsigned division. Signed division may be performed using instructionsto handle the sign of the quotient. It is well known in the art thatdivision is the most difficult of the four basic arithmetic operations(addition, subtraction, multiplication and division) to implement incomputers.

The DIVI instruction employs the hardware of data unit 110 to computeone digit of the desired quotient per execute pipeline stage, onceproperly set up. Note that the DIVI data unit instruction can only beused with a data transfer format that supports conditional datatransfers (and consequently conditional data unit operations). Thesedata transfer formats 7, 8, 9 and 10 will be fully described below. FIG.44 illustrates in schematic form the data flow within data unit 110during the DIVI instruction. Refer to FIG. 5 for details of theconstruction of data unit 110. Multiplexer Amux 232 selects data fromdata register 200b designated by the "src2" field on arithmetic logicunit first input bus 205 for supply to arithmetic logic unit 230 viainput A bus 241. Multiplexer Imux 222 selects the constant Hex "1" forsupply to multiplier second input bus 202 and multiplexer Smux 231selects this Hex "1" on multiplier second input bus 202 for supply torotate bus 244. Data from one of the data registers 200 designated bythe "src1" field supplies barrel rotator 235. This register can only bedata register D7, D5, D3 or D1 and is a conditional register sourceselected by multiplexer 215 based upon the "N" bit (bit 31) of statusregister 210. If the "N" bit of status register 210 is "0", then dataregister 200a designated by the "src1" field is selected. This registerselection preferably uses the same hardware used to provide conditionalregister selection in other instructions employing arithmetic logic unit230, except with the opposite sense. This register selection may beachieved via a multiplexer, such as multiplexer 215 illustrated in FIG.44, or by substituting the inverse of the "N" bit of status register 210for the least significant bit of the register field during specificationof the register. If the "N" bit of status register 210 is "1", then dataregister 200c, which is one less than the register designated by the"src1" field, is selected. Barrel rotator 235 left rotates this data byone bit and supplies the resultant to arithmetic logic unit 230 viainput B bus 241. The output of barrel rotator 235 is also saved to dataregister 200a via multiplexer Bmux 227, with bit 31 of multiple flagsregister 211 (before rotating) substituted for bit 0 of the output ofbarrel rotator 235. This destination register is the register designatedby the "src1" field. Multiplexer Mmux 234 selects the constant Hex "1"on multiplier second input bus 202 for supply to mask generator 239.Multiplexer Cmux 233 selects the output from mask generator 239 forsupply to arithmetic logic unit 230 via input C bus 243. Bit 0 carry-ingenerator 246 supplies bit 31 of multiple flags register 211 (beforerotating) to the carry-in input of arithmetic logic unit 230.

During the DIVI instruction arithmetic logic unit 230 receives afunction code F7-F0 of Hex "A6". This causes arithmetic logic unit 230to add the inputs upon input A bus 241 and input B bus 242 and leftshift the result with zero extend. This left shift is by one bit due tothe mask supplied by mask generator 239 in response to the Hex "1"input. This function is mnemonically A+B<0<. The resultant of arithmeticlogic unit 230 is stored in data register 200c designated by the "dst1"field. Multiple flags register 211 is rotated by one bit, and the leastsignificant bit (bit 0) of multiple flags register 211 is set accordingto the resultant produced by arithmetic logic unit 230. This same bit isstored in the "N" bit (bit 31) of status register 210. OR gate 247 formsthis bit stored in multiple flags register 211 and status register 210from C_(out) of arithmetic logic unit 230 ORed with bit 31 of the inputto barrel rotator 235. Note that other status register 210 bits "C", "V"and "Z" are set normally. If the data in data register 200a is X, thedata in data register 200b is Y and the data in data register 200c is Z,then the DIVI instruction forms X=X<<1 and Z=X[n]Z+Y. The "n" mnemonicindicates register source selection based upon the "N" status registerbit.

The DIVI instruction operates to perform iterations of a conditionalsubtract and shift division algorithm. This instruction can be used fora 32 bit numerator divided by a 16 bit divisor to produce a 16 bitquotient and a 16 bit remainder or a 64 bit numerator divided by a 32bit divisor to produce a 32 bit quotient and a 32 bit remainder. In the64 bit numerator case the 32 most significant bits of the numerator arestored initially in data register 200a and the 32 least significant bitsare initially stored in multiple flags register 211. Data register 200bstores the inverse of the divisor. For the first iteration of a divisionoperation either the DIVI instruction is executed unconditionally or the"N" bit of status register 210 is set to "0". The rotated number frombarrel rotator 235 is stored in data register 200a. Barrel rotator 235and the rotation of multiple flags register 211 effectively shift the 64bit numerator one place. Note that the most significant bit of multipleflags register 211 is the next most significant bit of the 64 bitnumerator and is properly supplied to the carry-in input of arithmeticlogic unit 230. The quantity stored in data register 200a is termed thenumerator/running remainder. The result of the trial subtraction isstored in data register 200c.

There are two cases for the result of the trial subtraction. If eitherthe most significant bit of the initial numerator was "1" or if theaddition of the negative divisor generates a carry, then thecorresponding quotient bit is "1". This is stored in the first bit ofmultiple flags register 211 and in the "N" bit of status register 210.For the next trial subtraction, multiplexer 215 selects data register200c for the B input for the next iteration by virtue of the "1" in the"N" bit of status register 210. Thus the next trial subtraction is takenfrom the prior result. If OR gate 247 generates a "0", then thecorresponding quotient bit is "0". Thus the next trial subtraction istaken from the prior numerator/running remainder stored in data register200a shifted left one place. This iteration continues for 32 cycles ofDIVI, forming one bit of the quotient during each cycle. The 32 bitquotient is then fully formed in multiple flags register 211. The 32 bitremainder is found in either data register 200a or data register 200cdepending upon the state of the "N" bit of status register 210.

The process for a 32 bit by 16 bit division is similar. The negateddivisor is left shifted 16 places before storing in data register 200b.The entire numerator is stored in data register 200a. The DIVIinstruction is repeated only 16 times, whereupon the quotient is formedin the 16 least significant bits of multiple flags register 211 and theremainder in the 16 most significant bits of either data register 200aor data register 200c depending on the state of the "N" bit of statusregister 210.

This technique employs hardware already available in data unit 100 toreduce the overhead of many microprocessor operations. The DIVIinstruction essentially forms one bit of an unsigned division.Additional software can be employed to support signed division. Fourdivide subroutines may be written for the cases of unsigned half word(32 bit/16 bit) divide, unsigned word (64 bit/32 bit) divide, signedhalf word (32 bit/16 bit) divide, and signed word (64 bit/32 bit)divide. Each of the four subroutines includes three phases: dividepreparation; divide iteration in a single instruction loop; and dividewrap-up. It is preferable to employ zero overhead looping and single 64bit DIVI instruction within the loop kernel.

The first part of each division subroutine is divide preparation. Thisfirst includes testing for a divisor of zero. If the divisor is "0",then the division subroutine is aborted and an error condition is noted.Next the sign bits are determined for the numerator and divisor. In thesigned division subroutines the sign of the quotient is set as an OR ofthe sign bits of the numerator and divisor. Then in signed division, ifeither the numerator or divisor is negative they are negated to obtain apositive number. The numerator is spit between a selected odd dataregister and the multiple flags register 211. For a word division, theupper 32 bits of the numerator are stored in the selected data registerand the lower 32 bits of the numerator are stored in multiple flagsregister 211. For a half word division all 32 bits of the numerator arestored in the selected data register. For the half word division, theunused lower bits of multiple flags register 211 are zero filled. Forhalf word division the divisor is stored in the upper 16 bits of a dataregister with the lower bits being zero filled. The divisor should benegated so that arithmetic logic unit 230 can form subtraction byaddition. The subroutines may compare the absolute values of the mostsignificant bits of the numerator and denominator to determine if thequotient will overflow.

The heart of each divide subroutine is a loop including a single DIVIinstruction. It is very advantageous to write to one of the registeraddresses LSRE2-LSRE0 to initialize a zero overhead one instructionloop. Sixteen iterations are needed for half word quotients and 32 forword quotients. Since the loop logic 720 decrements to zero, the loopcounter should be loaded with one less than the desired number ofiterations. It is also possible to place up to two iterations of theDIVI instruction in the delay slots following loop logic initialization.The single instruction within this loop is the DIVI instruction, whichhas been fully described above.

Each division subroutine is completed with divide wrap-up. Dividewrap-up includes the following steps. The quotient is moved frommultiple flags register 211 to a data register. If the sign of thequotient is negative, then "1" is added to the quotient in the dataregister to convert from "1's" complement representation to twoscomplement representation. If the remainder is needed it is selectedbased upon the "N" bit of status register 210.

A further refinement increases the power of the DIVI instruction in eachof the divide subroutines when the numerator/running remainder has oneor more strings of consecutive "0's". Before beginning the inner loop,the divisor is tested for leading "0's" via LMO/RMO/LMBC/RMBC circuit237. The input on bus 206 is directed through LMO/RMO/LMBC/RMBC circuit237 using the "FMOD" field of data register D0 or bits 52, 54, 56 and 56of the "8-bit ALU code" of an arithmetic instruction word. The dataregister holding the high order bits of the numerator/running remainderis left shifted by a number of places equal to the number of leading"0's". In the same fashion, the data in multiple flags register 211 isleft shifted, with zeros inserted into lower order bits corresponding tothe zeros in the quotient bits. The inner loop includes additionaloperations in this refinement. One additional operation searches forstrings of consecutive "0's" in the numerator/running remainder. Thequotient bit for each place where the numerator/running remainder is "0"is also "0". Thus if such strings of consecutive "0's" can be detected,then the DIVI instruction for those places can be eliminated. Thisadditional operation employs a conditional source register in the samemanner as the DIVI instruction. The input on bus 206 is directed throughLMO/RMO/LMBC/RMBC circuit 237 using the "FMOD" field. Arithmetic logicunit 230 generates a resultant equal to the data on input C bus 243,which is the number of "0's" in leading bits of the numerator/runningremainder. This result is stored in one of data registers 200 D7-D0 nototherwise used by the subroutine. The loop count stored in the loopcount register LC2-LC0 used for the divide iteration loop is decrementedby this number of consecutive "0's". The following DIVI employs thiscount as the shift amount via multiplier second input bus 202. Multipleflags register 211 is slightly modified to also rotate by this amountand transfer the rotated out most significant bits into the leastsignificant bits of data register 200a. The least significant bits ofmultiple flags register 211 are zero filled during this rotate. Usingthis instruction skips over consecutive "0's" in the numerator/runningremainder, placing "0's" in the corresponding quotient bits and rotatingpast the consecutive "0's". In instances where the numerator/runningremainder has strings of consecutive "0's", this two instruction loopproduces the quotient faster than the single instruction loop.

This is illustrated in flow chart form in FIG. 45. The divide algorithmis begun at In block 1001. First, decision block 1002 tests for adivisor of 0 and if true the algorithm is exited at divide by zero (/0)exit block 1003. Next decision block 1004 compares the absolute value ofthe divisor to the high order bits of the numerator. If the absolutevalue of the divisor is less than the high order bits of the numerator,then the algorithm is exited at overflow exit block 1005.

Block 1006 sets the quotient stored in multiple flags register 211 tozero and sets the loop count to 16. Note that this example is of a 32bit by 16 bit divide. The loop count would be set to 32 for a 64 bit by32 bit divide. Block 1007 sets two registers by loading the numeratorinto register A and the divisor into register B. Block 1008 sets V, thesign of the quotient, equal to the exclusive OR of the sign of thenumerator and the denominator. Decision block 1009 tests to determine ifthe sign of the quotient is positive. If so, then block 1010 negates thedata in register B, which is the divisor. If not, then register B is notchanged. Block 1011 sets n equal to the left most one place of theabsolute value of the data in register B. This tests for leading zerosin the division. Block 1012 left shifts the data in register A, thenumerator/running remainder, and the data in register B, the divisor, nplaces.

The division loop begins with block 1013. Block 1013 sets m equal to theleft most one place of the data in register A. Decision block 1014compares m to the loop count. If m is greater than the loop count, thenblock 1015 sets m equal to the loop count. Block 1016 left shifts thenumerator/running remainder and the quotient m places. Decision block1017 tests to determine if the previously computed sign of the quotientis positive. If V is positive, then block 1018 sets the quotient Q equalto Q plus number including a string of m number of sign bits, fillingthe places vacated in block 1016. Block 1019 decrements the loop countby the left most one place amount m.

Block 1020 performs the trial subtraction of the data in register A, thenumerator/running remainder, and the divisor in register B. Note thatblocks 1009 and 1010 insure that the data in register B is negative.Decision block 1021 determines if the trial subtraction changes sign. Ifthere is a sign change, then block 1022 sets the least significant bitof the quotient equal to the sign V. If there is no sign change, thenblock 1023 sets the least significant bit of the quotient equal to theinverse of the sign V and block 1024 sets A equal to the sum C. Ineither case, block 1025 left shifts register A one place. Note that asdescribed above, the single DIVI instruction performs the actions ofblocks 1020 through 1025.

Blocks 1026 and 1027 handle the loop. Block 1026 decrements the loopcount. Block 1027 determines if the loop count is less than zero. Ifnot, then algorithm control returns to block 1013 to repeat the loop. Ifthe loop count is less than zero, then the loop is complete. Preferablythe zero-overhead loop logic handles the operations of blocks 1026 and1027.

Upon exiting the loop, some clean up steps are needed. Decision block1028 determines if the quotient is less than zero. If so, then block1029 adds one to the quotient. This provides the proper conversion fromone's complement to two's complement. Block 1030 sets the remainderequal to the high order bits stored in the A register. The algorithm isexited via exit block 1031.

Note the DIVI instruction advantageously performs several crucialfunctions in the inner loop. Thus the DIVI instruction is highly usefulin this algorithm. Note also, in the absence of such a DIVI instruction,digital image/graphics processor 71 may still perform this algorithmusing a determination of the left most ones in accordance with theprogram illustrated in FIG. 45.

FIG. 46 illustrates an alternative embodiment of the division algorithmthat additionally uses a left most ones determination of the exclusiveOR of the data in registers A and B. The initial steps divide by 0 andoverflow steps illustrated in FIG. 46 are identical to those illustratedin FIG. 45. Block 1032 sets register A equal to the absolute value ofthe numerator and register B equal to the absolute value of the divisor.Block 1008 sets the sign V of the quotient as before.

Block 1011 determines the left most one place b of the absolute value ofthe divisor. Block 1033 left shifts the data in register B the number ofplaces of the left most one. Block 1034 left shifts register A by b, thenumber of places of the left shift of register B.

Block 1035 begins the loop. Block 1035 determines the left most oneplace of the data in register A and sets c equal to 29 minus the leftmost one place a. Block 1036 sets t equal to the loop count minus c.Decision block 1037 determines if the loop count is less than c. If so,then block 1038 sets c equal to the loop count. Block 1039 left shiftsboth the data in register A and the quotient c places. Block 1039 alsodecrements the loop count by c. This step skips over trial subtractionfor zeros in the numerator/running remainder.

Block 1040 determines the left most zero place of A B. Block 1041determines if the loop count is less than or equal to zero or if x, theleft most zero place of A B, is zero. If not, then both the data inregister A and the quotient are left shifted one place and the loopcount is decremented by 1.

Block 1043 determines if t, the difference of the loop count and ccomputed in block 1036, is less than zero. If so, then the loop isexited. If not, then block 1044 computes the trial subtraction A-B andincrements the quotient by 1. Block 1045 determines if the loop count isgreater than zero. If so, then the algorithm repeats the loop startingat block 1035. If not, or if t was less than zero, then the data inregister A, now forming the remainder, is right shifted by b places.

The remaining steps involve clean up. Decision block 1047 determines ifthe sign of the quotient is less than zero. If so, then the quotient isreplaced by its inverse. In either event, decisions block 1049determines if the numerator/running remainder N is less than zero. Ifso, then the remainder stored in as the higher order bits in register Ais replaces by its inverse. The algorithm is exited via exit block 1031.

A description of the data transfer formats and an explanation orglossary of various bits and fields of the parallel data transferformats of instruction words of FIG. 43 follows. As previously describedabove in conjunction with the glossary of bits and fields of the dataunit formats these bits and fields define not only the instruction wordbut also the circuitry that enable execution of the instruction word.

Transfer format 1 is recognized by bits 38-37 not being "00", bits 30-28not being "000" and bits 16-15 not being "00". Transfer format 1 iscalled the double parallel data transfer format. Transfer format 1permits two independent accesses of memory 20, a global access and alocal access limited to the memory sections corresponding to the digitalimage/graphics processor. The "Lmode" field (bits 38-35) refers to alocal transfer mode, which specifies how the local address unit ofaddress unit 120 operates. This field is preferably decoded as shown inTable

                  TABLE 45                                                        ______________________________________                                        Lmode                                                                           field                                                                         3 3 3 3 Expression Operation                                                  8 7 6 5 Syntax Description                                                  ______________________________________                                        0 0 X X              no operation                                               0 1 0 0 *(An++=Xm) post-addition of index register                              with modify                                                                 0 1 0 1 *(An--=Xm) post-subtraction of index register                           with modify                                                                 0 1 1 0 *(An++=Imm) post-addition of offset with modify                       0 1 1 1 *(An--=Imm) post-subtraction of offset                                  with modify                                                                 1 0 0 0 *(An+Xm) pre-addition of index register                               1 0 0 1 *(An-Xm) pre-subtraction of index register                            1 0 1 0 *(An+Imm) pre-addition of offset                                      1 0 1 1 *(An-Imm) pre-subtraction of offset                                   1 1 0 0 *(An+=Xm) pre-addition of index register                                with modify                                                                 1 1 0 1 *(An-=Xm) pre-subtraction of index register                             with modify                                                                 1 1 1 0 *(An+=Imm) pre-addition of offset with modify                         1 1 1 1 *(An-=Imm) pre-subtraction of offset                                    with modify                                                               ______________________________________                                    

The "d" field (bits 34-32) designates one of the data registers D0-D7 tobe the source or destination of a local bus transfer. The "e" bit (bit31) if "1" designates sign extend, else if "0" designates zero extendfor the local data transfer. This is operative in a memory to registertransfer when the local "siz" field (bits 30-29) indicates less than afull 32 bit word size. This "e" bit is ignored if the data size is 32bits. The combination of "e" (bit 31)="1" and "L" (bit 21)="0", whichwould otherwise be meaningless, indicates a local address unitarithmetic operation. The local "siz" field (bits 30-29) is preferablycoded as shown in Table

                  TABLE 46                                                        ______________________________________                                        Size field                                                                    3             2                                                                 0 9 Data word size                                                          ______________________________________                                        0             0     byte 8 bits                                                 0 1 half word 16 bits                                                         1 0 whole word 32 bits                                                        1 1 reserved                                                                ______________________________________                                    

The "s" bit (bit 28) sets the scaling mode that applies to local addressindex scaling. If the "s" bit is "1" the index in the addresscalculation, which may be recalled from an index register or aninstruction specified offset, is scaled to the size indicated by the"siz" field. If the "s" bit is "0", then no scaling occurs. Aspreviously described this index scaling takes place in index scaler 614.If the selected data size is 8 bits (byte), then no scaling takes placeregardless of the status of the "s" bit. In this case only, the "s" bitmay be used as an additional offset bit. If the "Lmode" field designatesan offset then this "s" bit becomes the most significant bit of theoffset and converts the 3 bit offset index of the "Lim/x" field to 4bits. The "La" field (bits 27-25) designates an address register withinlocal address unit 620 of address unit 120 for a local data transfer.The "L" bit (bit 21) indicates the local data transfer is a loadtransferring data form memory to register (L="1") or a storetransferring data from register to memory (L="0") transfer. The "Lim/x"field (bits 2-0) specifies either the register number of an indexregister or a 3 bit offset depending on the coding of the "Lmode" field.

The global data transfer operation is coded in a fashion similar to thecoding of the local data transfer. The "L" bit (bit 17) is a globalload/store select. This bit determines whether the global data transferis a memory to register ("L"="1") transfer, also know as a load, or aregister to memory ("L"="0") transfer, also known as a store. The"Gmode" field (bits 16-13) defines a global transfer mode in the sameway the local transfer mode is defined by the "Lmode" field. This fieldis preferably decoded as shown in Table

                  TABLE 47                                                        ______________________________________                                        Gmode                                                                           field                                                                         1 1 1 1 Expression Operation                                                  6 5 4 3 Syntax Description                                                  ______________________________________                                        0 0 X X              no operation                                               0 1 0 0 *(An++=Xm) post-addition of index register                              with modify                                                                 0 1 0 1 *(An--=Xm) post-subtraction of index register                           with modify                                                                 0 1 1 0 *(An++=Imm) post-addition of offset with modify                       0 1 1 1 *(An--=Imm) post-subtraction of offset                                  with modify                                                                 1 0 0 0 *(An+Xm) pre-addition of index register                               1 0 0 1 *(An-Xm) pre-subtraction of index register                            1 0 1 0 *(An+Imm) pre-addition of offset                                      1 0 1 1 *(An-Imm) pre-subtraction of offset                                   1 1 0 0 *(An+=Xm) pre-addition of index register                                with modify                                                                 1 1 0 1 *(An-=Xm) pre-subtraction of index register                             with modify                                                                 1 1 1 0 *(An+=Imm) pre-addition of offset with modify                         1 1 1 1 *(An-=Imm) pre-subtraction of offset                                    with modify                                                               ______________________________________                                    

The "reg" field (bits 12-10) identifies a register. The "reg" fielddesignates the number of the source register in the case of a store, orthe number of the destination register in the case of a load. The"0bank" field (bits 20-18) contains three bits and identifies a bank ofregisters in the lower 64 registers. These registers have register banknumbers in the form "0XXX". The 3 bit "0bank" filed combines with the 3bit "reg" field to designate any register in the lower 64 registers asthe data source or destination for the global data transfer. The "e" bit(bit 9) if "1" designates sign extend, else if "0" designates zeroextend for the global data transfer. This is operative in a memory toregister transfer when the global "siz" field (bits 8-7) indicates lessthan a full 32 bit word size. This "e" bit is ignored if the data sizeis 32 bits. The combination of "e" (bit 9)="1" and "L" (bit 17)="0"indicates a global address unit arithmetic operation. The global "siz"field (bits 8-7) is preferably coded as shown in Table

                  TABLE 48                                                        ______________________________________                                        Size field                                                                    8             7     Data word size                                            ______________________________________                                        0             0     byte 8 bits                                                 0 1 half word 16 bits                                                         1 0 whole word 32 bits                                                        1 1 reserved                                                                ______________________________________                                    

The "s" bit (bit 6) sets the scaling mode that applies to global addressindex scaling. If the "s" bit is "1" the index in the addresscalculation, which may be recalled from an index register or aninstruction specified offset, is scaled to the size indicated by the"siz" field. If the "s" bit is "0", then no scaling occurs. No scalingtakes place regardless of the status of the "s" bit if the "siz" fielddesignates a data size of 8 bits. If the "Gmode" field designates anoffset then this "s" bit becomes the most significant bit of the offsetand converts the 3 bit offset index of the "Gim/x" field to 4 bits. The"Ga" field (bits 5-3) designates an address register within globaladdress unit 610 of address unit 120 for a local bus transfer. The"Gim/x" field (bits 24-22) specifies either the register number of anindex register or a 3 bit offset depending on the coding of the "Gmode"field. The "Ga" field (bits 5-4) specifies the register number of theaddress register used in computing the memory address of the global datatransfer.

Data transfer format 2 is recognized by bits 38-37 not being "00", bits30-28 being "000" and bits 16-15 not being "00". Data transfer format 2is called the XY patch format. Data transfer format 2 permits addressingmemory 20 in an XY patch manner multiplexing addresses from both theglobal and local address units of address unit 120. The "o" bit (bit 34)enables outside XY patch detection. When "o" bit is set to "1", theoperations specified by the bits "a" and "n" are performed if thespecified address is outside the XY patch. Otherwise, when "o" bit is"0", the operations are performed if address is inside the patch. The"a" bit (bit 33) specifies XY patch memory access mode. When the "a" bitis set to "1", the memory access is performed regardless of whether theaddress is inside or outside the XY patch. When the "a" bit is set to"0", the memory access is inhibited if the address is outside (if the"o" bit is "1") or inside (if the "o" bit is "0") the patch. The "n" bit(bit 32) specifies XY patch interrupt mode. When the "n" bit is set to"1", an interrupt flag register bit for XY patch is set to "1" if theaddress is outside (if "o" bit is "1") or inside (if "o" bit is "0") thepatch. When "n" bit is set to "0", the XY patch interrupt request flagis not set.

Other fields are defined in the same manner detailed above. The "Lmode"field specifies the local address calculation mode as shown in Table 45.This local address calculation includes a local address registerdesignated by the "La" field and either a 3 bit unsigned offset or alocal index register designated by the "Lim/x" field. The "Gmode" fieldspecifies the global address calculation. A global unsigned 3 bit offsetor a global index register indicated by the "Gim/X" field is combinedwith the address register specified by the "Ga" field to form the globaladdress. The 4 bit "bank" field (bits 21-18) identifies a data registerbank and is combined with the 3 bit "reg" field identifying a registernumber to designate any register as the data source or destination foran XY Patch access. The "L" bit is a load/store select. This bitdetermines whether an XY Patch access is a memory to register ("L"="1")transfer, also know as a load, or register to memory ("L"="0") transfer,also known as a store. The "e" bit if "1" designates sign extend, elseif "0" designates zero extend. This is operative in a load operation(memory to register data transfer) when the "siz" field indicates lessthan a full 32 bit word size. This "e" bit is ignored if the data sizeis 32 bits. The combination of "e"="1" with "L"="0" indicates a patchedaddress unit arithmetic operation. The "s" bit sets the scaling modethat applies to global address index scaling. If the "s" bit is "1" thedata recalled from memory is scaled to the size indicated by the "siz"field. If the "s" bit is "0", then no scaling occurs. If the selecteddata size is 8 bits (byte), then no scaling takes place regardless ofthe status of the "s" bit. In this case only, the "s" bit is used as themost significant bit of the offset converting the 3 bit "Gim/x" offsetindex to 4 bits.

Data transfer format 3 is recognized by bits 38-37 not being "00", bit24 being "0" and bits 16-13 being "0000". Data transfer format 3 iscalled the move and local data transfer format. Data transfer format 3permits a load or store of one of the data registers 200 via the localdata port in parallel with a register to register move using global portsource data bus Gsrc 105 and global port destination data bus Gdst 107.The local data port operation is defined by the fields "Lmode", "d","e", "siz", "s", "La", "L" and "Lim/x" in the manner described above.The register to register move is from the register defined by the bankindicated by the "srcbank" field (bits 9-6) and the register numberindicated by the "src" field (bits 12-10) to the register defined by thebank indicated by the "dstbank" field (bits 21-18) and the registernumber indicated by the "dst" field (bits 5-3).

Data transfer format 3 supports digital image/graphics processorrelative addressing. The "Lrm" field (bits 23-22) indicate the type ofaddressing operation. This is set forth in Table 49.

                  TABLE 49                                                        ______________________________________                                        Lrm field                                                                     8        7            Addressing Mode                                         ______________________________________                                        0        0            normal addressing                                         0 1 reserved                                                                  1 0 Data memory base                                                            address DBA                                                                 1 1 Parameter memory base                                                       address PBA                                                               ______________________________________                                    

Specification of DBA causes local address unit 620 to generate the baseaddress of its corresponding memory. Likewise, specification of PBAcauses local address generator 620 to generate the base address of thecorresponding parameter memory. The base address generated in thismanner may be combined with the index stored in an index register or anoffset field in any of the address generation operations specified inthe "Lmode" field shown in Table 45.

This data transfer format also supports command word generation. If thedestination of the register to register move is the zero value addressregister of the global address unit A15, then the instruction worddecoding circuitry initiates a command word transfer to a designatedprocessor. This command word is transmitted to crossbar 50 via theglobal data port accompanied by a special command word signal. Thisallows interprocessor communication so that, for example, any of digitalimage/graphics processors 71, 72, 73 and 74 may issue an interrupt toother processors. This process is detailed above.

Data transfer format 4 is recognized by bits 38-37 not being "00", bit24 being "0" and bits 16-13 being "0001". Data transfer format 4 iscalled the field move and local data transfer format. Data transferformat 4 permits a load or store of one of the data registers 200 viathe local data port in parallel with a register to register field moveusing global port source data bus Gsrc 105 and global port destinationdata bus Gdst 107. The local data port operation is defined by thefields "Lmode", "d", "e" (bit 31), "siz" (bits 30-29), "s", "La", "L"and "Lim/x" in the manner described above.

The register to register field move is from the data register defined bythe register number indicated by the "src" field (bits 12-10) to theregister defined by the bank indicated by the "dstbank" field (bits21-18) and the register number indicated by the "dst" field (bits 5-3).The "D" bit (bit 6) indicates if the field move is a field replicatemove if "D"="1", or a field extract move if "D"="0". In a fieldreplicate move the least significant 8 bits of the source register arerepeated four times in the destination register if the "siz" field (bits8-7) indicates a byte size, and the least significant 16 bits of thesource register are duplicated in the destination register if the "siz"field (bits 8-7) indicates a half word size. If the "siz" field indicatea word size, then the whole 32 bits of the source register aretransferred to the destination register without replication regardlessof the state of the "D" bit. In a field extract move the "itm" field(bits 23-22) indicates the little endian item number to be extractedfrom the source register. The particular bits extracted also dependsupon the "siz" field. When the data size of the "siz" field (bits 8-7)is byte, then "itm" may be 0, 1, 2 or 3 indicating the desired byte.When the data size of the "siz" field (bits 8-7) is half word, then"itm" may be 0 or 1 indicating the desired half word. The "itm" field isignored if the "siz" field (bits 8-7) is word. The extracted field fromthe source register is sign extended if the "e" bit (bit 9) is "1" andzero extended if the "e" bit (bit 9) is "0". The "e" field is ignoredduring field replicate moves.

Data transfer format 5 is recognized by bits 38-37 not being "00", bit24 being "1" and bits 16-15 being "00". Data transfer format 5 is calledlocal long offset data transfer. Data transfer format 5 permits a globalport memory access using an address constructed in the local addressunit because no global data transfer is possible. The local data portoperation is defined by the fields "Lmode", "d", "e", "siz", "s", "La"and "L" in the manner described above. The register source ordestination corresponds to the register number designated in the "reg"field (bits 34-32) in the bank of registers designated in the "bank"field (bits 21-18). The "Local Long Offset/x" field (bits 14-0)specifies a 15 bit local address offset or the three least significantbits specify an index register as set by the "Lmode" field. A programmermight want to use this data transfer format using an index registerrather than the "Local long offset" field because data transfer format 5permits any data unit register as the source for a store or as thedestination for a load. The "Lmode" field indicates whether this fieldcontains an offset value or an index register number. If the selecteddata size is 8 bits (byte), then no scaling takes place regardless ofthe status of the "s" bit. In this case only, the "s" bit becomes themost significant bit of the offset converting the 15 bit "Local longoffset" field into 16 bits. The "Lrm" field (bits 23-22) specify anormal address operation, a data memory base address operation or aparameter memory base operation as listed above in Table 49.

Data transfer format 6 is recognized by bits 38-37 being "00", bits16-15 not being "00" and bit 2 being "0". Data transfer format 6 iscalled global long offset data transfer. Data transfer format 6 issimilar to data transfer format 5 except that the address calculationoccurs in the global address unit. The fields "bank", "L", "Gmode","reg", "e", "siz", "s" and "Ga" are as defined above. The "Global LongOffset/x" field (bits 36-22) specifies a global offset address or anindex register depending on the "Gmode" field. This is similar to the"Local Long Offset/x" field discussed above. The "Grm" field (bits 1-0)indicate the type of addressing operation. This is set forth in Table50.

                  TABLE 50                                                        ______________________________________                                        Grm field                                                                     1        0            Addressing Mode                                         ______________________________________                                        0        0            normal addressing                                         0 1 reserved                                                                  1 0 Data memory base                                                            address DBA                                                                 1 1 Parameter memory base                                                       address PBA                                                               ______________________________________                                    

This operates in the same fashion as the "Lrm" field described aboveexcept that the address calculation takes place in global address unit610.

Data transfer format 7 is recognized by bits 38-37 not being "00", bit24 being "0" and bits 16-14 being "001". Data transfer format 7 iscalled the non-data register data unit operation and local data transferformat. Data transfer format 7 permits a local port memory access inparallel with a data unit operation where the first source forarithmetic logic unit 230 and the destination for arithmetic logic unit230 may be any register on digital image/graphics processor 71. Thelocal data port operation is defined by the fields "Lmode", "d", "e","siz", "s", "La", "Lrm", "L" and "Lim/x" in the manner described above.The "Adstbnk" field (bits 21-18) specifies a bank of registers for thearithmetic logic unit destination. This field specifies a registersource in combination with the "dst" field in data unit formats A, B andC, and the "dst1" field in data unit format D. The "As1bank", fieldspecifies a bank of registers for the first arithmetic logic unitsource. This specifies a register source in combination with the "src1"field in data unit formats A, B, C and D. These data unit operations arecalled long distance arithmetic logic unit operations because the firstsource and the destination need not be the data registers 200 of dataunit 110.

Data transfer format 8 is recognized by bits 38-37 being "00", bit 24being "0" and bits 16-13 being "0000". Data transfer format 8 is calledthe conditional data unit operation and conditional move transferformat. Data transfer format 8 permits conditional selection of thefirst source for arithmetic logic unit 230 and conditional storing ofthe resultant of arithmetic logic unit 230. The conditional arithmeticlogic unit operations are defined by the fields "cond.", "c", "r", "g"and "N C V Z".

The "cond." field (bits 35-32) defines an arithmetic logic unitoperation from conditional register sources and conditional storage ofthe arithmetic logic unit resultant. This field is defined in Table 41.These conditions are evaluated based upon the "N", "C", "V" and "Z" bitsof status register 210.

The specified condition may determine a conditional register source, aconditional storage of the result of arithmetic logic unit 230 or aconditional register to register move. The "c" bit (bit 31) determinesconditional source selection. If the "c" bit is "0", then the firstsource for arithmetic logic unit 230 is unconditionally selected basedupon the "src1" field (bits 47-45) of the data unit format portion ofthe instruction word. If the "c", bit is "1", then the register sourceis selected between an odd and even register pair. Note that in thiscase the "src1" field must specify an odd numbered data register 200. Ifthe condition is true, then the specified register is selected as thefirst source for arithmetic logic unit 230. If the condition is false,then the corresponding even data register one less than the specifieddata register is selected as the source. The preferred embodimentsupports conditional source selection based upon the "N" bit of statusregister 210. If the "N" field of status register 210 is "1" then thedesignated data register is selected as the first source for arithmeticlogic unit 230. If the "N" field of status register 210 is "0", then thedata register one less is selected. This selection can be made by amultiplexer, such as multiplexer 215 illustrated in FIG. 44, or bysubstitution of the "N" field of status register 210 for the leastsignificant bit of the register number. While the preferred embodimentsupports only conditional source selection based upon the "N" bit ofstatus register 210, it is feasible to provide conditional sourceselection based upon the "C", "V" and "Z" bits of status register 210.

Data transfer format 8 supports conditionally storing the resultant ofarithmetic logic unit 230. The "r" bit (bit 30) indicates if storing theresultant is conditional. If the "r" bit is "1" then storing theresultant is conditional based upon the condition of the "cond." field.If the "r" bit is "0", then storing the resultant is unconditional. Notethat in a conditional result operation, the status bits of statusregister 210 are set unconditionally. Thus these bits may be set even ifthe result is not stored.

Data transfer format 8 also permits a conditional register to registermove operation. The condition is defined by the same "cond." field thatspecifies conditional data unit operations. The register data source ofthe move is defined by the bank indicated by the "srcbank" field (bits9-6) and the register number indicated by the "src" field (bits 12-10).The register data destination is defined by the bank indicated by the"dstbank" field (bits 21-18) and the register number indicated by the"dst" field (bits 5-3). The "g" bit (bit 29) indicates if the data moveis conditional. If the "g" bit is "1", the data move is conditionalbased upon the condition specified in the "cond." field. If the "g" bitis "0", the data move is unconditional. Note that a destination of thezero value address register A15 of the global address unit generates acommand word write operation as previously described above. Thus datatransfer format 8 permits conditional command word generation.

The "N C V Z" field (bits 28-25) indicates which bits of the status areprotected from alteration during execution of the instruction. Theconditions of the status register are: N negative; C carry; V overflow;and Z zero. If one or more of these bits are set to "1", thecorresponding condition bit or bits in the status register are protectedfrom modification during execution of the instruction. Otherwise thestatus bits of status register 210 are set normally according to theresultant of arithmetic logic unit 230.

Data transfer format 9 is recognized by bits 38-37 being "00", bit 24being "0" and bits 16-13 being "0001". Data transfer format 9 is calledthe conditional data unit operation and conditional field move transferformat. Data transfer format 9 permits conditional selection of thefirst source for arithmetic logic unit 230 and conditional storing ofthe resultant of arithmetic logic unit 230 in the same manner as datatransfer format 8. The conditional arithmetic logic unit operations aredefined by the fields "cond.", "c", "r" and "N C V Z" as noted above inthe description of data transfer format 8.

Data transfer format 9 also supports conditional register to registerfield moves. The condition is defined by the same "cond." field thatspecifies conditional data unit operations. The source of the field movemust be one of data registers 200. The "src" field (bits 12-10)specifies the particular data register. The destination of the registerto register move is the register defined by the register bank of the"dstbank" field (bits 21-18) and the register number of the "dst" field(bits 5-3). The fields "g" (bit 29), "itm" (bits 23-22), "e" (bit 9),"siz" (bits 8-7) and "D" (bit 6) define the parameters of theconditional field move. The "g" bit determines that the field move isunconditional if "g"="0" and that the field move is conditional if"g"="1". The "D" bit indicates if the field move is a field replicatemove if "D"="1", or a field extract move if "D"="0". These options havebeen described above. In a field extract move the "itm" field (bits23-22) indicates the little endian item number to be extracted from thesource register base upon the data size specified by the "siz" field.The extracted field from the source register is sign extended if the "e"bit (bit 9) is "1" and zero extended if the "e" bit (bit 9) is "0". The"e" field is ignored during field replicate moves.

Data transfer format 10 is recognized by bits 38-37 being "00", bits16-15 not being "00" and bit 2 being "1". Data transfer format 10 iscalled the conditional data unit operation and conditional global datatransfer format. Data transfer format 10 permits conditional selectionof the first source for arithmetic logic unit 230 and conditionalstoring of the resultant of arithmetic logic unit 230. The conditionalarithmetic logic unit operations are defined by the fields "cond.", "c","r" and "N C V Z" as noted above in the description of data transferformat 8.

Data transfer format 10 also supports conditional memory access viaglobal address unit 610. The conditional memory access is specified bythe fields "g", "Gim/x", "bank", "L", "Gmode", "reg", "e", "siz", "s","Ga" and "Grm" as previously described. The "g" bit (bit 29) indicatesif the data move is conditional in the manner previously describedabove. The "Gim/x" field specifies either an index register number or anoffset field depending upon the state of the "Gmode" field. The "bank"field specifies the register bank and the "reg" field specifics theregister number of the register source or destination of the globalmemory access. The "L" indicates a load operation (memory to registertransfer) by a "1" and a store operation (register to memory transfer)by a "0". The "Gmode" field indicates the operation of global data unit610 as set forth in Table 47. The "e" bit indicates sign or zeroextension for load operations. Note an "L" field of "0" and an "e" fieldof "1" produces an address arithmetic operation. The "siz" fieldspecifies the data size as set forth in Table 48. The "s" bit indicateswhether the index is scaled to the data size as described above. The"Ga" field specifies the address register used in address computation.The "Grm" field indicates the type of addressing operation as set forthin Table 50.

Data transfer format 11 is recognized by bits 38-37 being "00", bit 24being "0" and bits 16-14 being "001". Data transfer format 11 is calledthe conditional non-data register data unit format. Data transfer format11 permits no memory accesses. Instead data transfer format 11 permitsconditional data unit operation with one source and the destination forarithmetic logic unit 230 as any register within digital image/graphicsprocessor 71. These are called long distance arithmetic logic unitoperations. The "As1bank" field (bits 9-6) specifies a bank of registersthat defines the first arithmetic logic unit source in combination withthe "src1" field (bits 47-45) in the data unit format of theinstruction. Thus this source may be any register within digitalimage/graphics processor 71. The "Adstbnk" field (bits 21-18) specifiesa bank of registers that defines the arithmetic logic unit destinationin combination with the "dst" field (bits 50-48) in data unit formats A,B and C, and the "dst1" field (bits 50-48) in data unit format E. Theconditional arithmetic logic unit operations are defined by the fields"cond.", "c", "r" and "N C V Z" as noted above in the description ofdata transfer format 8.

The "R" bit (bit 0) is a reset bit. The "R" bit is used only at reset.This "R" bit is used only upon reset. The "R" bit determines whether thestack pointer register A14 is initialized upon reset of digitalimage/graphics processor 71. This "R" bit is not available to users viathe instruction set and will not be further described.

With so many operations possible within a single instruction, it ispossible that more than one operation of a single instruction specifiesthe same destination data register 200. In such an event a fixed orderof priority determines which operation saves its result in the commonlyspecified destination register. This fixed order of priority is shown inTable 51 in order from highest priority to lowest priority.

                  TABLE 51                                                        ______________________________________                                        Priority                                                                        Rank Operation                                                              ______________________________________                                        highest         Global address unit                                              data transfer                                                                median Local address unit                                                      data transfer                                                                lowest Data unit                                                               Multiply/ALU => Multiply                                                      Rotate/ALU => ALU                                                          ______________________________________                                    

Thus global address unit data transfers have the highest priority anddata unit operations have the lowest priority. Since more than one dataunit operation can take place during a single instruction, there is afurther priority rank for such operations. If a multiply operation andan arithmetic logic unit operation have the same destination register,then only the result of the multiply operation is stored. In this caseno status bits are changed by the aborted arithmetic logic unitoperation. Note that if the storing of the result of an arithmetic logicunit operation is aborted due to conflict with a global or local addressunit data transfer, then the status bits are set normally. If a barrelrotation result and an arithmetic logic unit operation have the samedestination, then only the results of the arithmetic logic unitoperation is stored. In this case the status bits are set normally forthe completed arithmetic logic unit operation.

This application will now describe how multiprocessor integrated circuit100 can be programmed to solve some typical graphics processingproblems.

One key problem in graphics processing is image encoding. In facsimiletransmission, video conferencing, multi-media computing and highdefinition television a key problem is the amount of data to betransmitted or stored in full motion video. There are known techniquesfor data compression of individual images that can be used for eachframe of video. Current technology cannot simultaneously providesufficient image compression and acceptable video quality for real timevideo. Much interest is directed toward algorithms and processors thatcan provide image compression for full motion video.

There is a proposed motion picture compression standard from the MotionPicture Experts Group (MPEG) which utilizes motion estimation. In motionestimation consecutive frames are compared to detect changes. Thesechanges can then be encoded and transmitted rather than the data of theentire frame. The current proposed MPEG standard compares 16 by 16 pixelblocks of consecutive pixels. One block is displaced to differingpositions ±7 pixels in the vertical dimension and ±7 pixels in thehorizontal direction. For each displaced position, the proposed standardcomputes the sum of the absolute value of respective differences betweenpixels. The displaced position yielding the least sum of the absolutevalue of differences defines a motion vector for that 16 by 16 pixelblock. Once the entire image has been compared, then some frames aretransmitted in large degree via motion vectors rather than by pixelvalues.

This motion estimation computation involves a very large amount ofcomputation. Each displaced position needs 256 differences, whoseabsolute values are summed. There are 225 such displaced positions(15×15) for each 16 by 16 pixel block. In relatively modest imageresolutions such as the h.261 standard proposed for video conferencingwith 352 columns lines and 288 rows, each frame includes 198 such 16 by16 pixel blocks. Thus each frame requires about 23 million subtractions,23 million absolute values and numerous other computations. This taskrequires enormous computation capability since full motion videorequires at least 24 to 30 frames per second. The most voluminousportion of these computations are the subtractions for each pixel ofeach displaced position of each 16 by 16 pixel block and the absolutevalue function. Though there are many other computations, if there werean efficient manner of performing these most voluminous calculations theentire task would be feasible.

FIG. 47 illustrates schematically the operation of digitalimage/graphics processor 71 in a four instruction inner loop for MPEGmotion estimation. Note that the example data values indicated are inhexadecimal numbers. Within this four instruction loop, digitalimage/graphics processor 71 computes 8 differences on 8 bit pixels,forms the absolute values and updates a running sum of the absolutevalues. This operation will be described in detail to demonstrate thecomputation power of digital image/graphics processor 71 illustrated inFIG. 3. The four instructions of the inner loop are:

    ______________________________________                                        1a.        CurrPixel =mzc CurrPixel-PrevPixel                                   1b. ∥ GX.sub.-- CNTIndex = MF                                        1c. ∥ CurrPixel = *(LA.sub.-- Curr++=4)                              2a.  SumABS =mc (SumABS+CurrPixel)& @MF                                         | (SumABS-CurrPixel)&˜@MF                                    2b. ∥ GA.sub.-- CarryCount = &*(GA.sub.-- CarryCount+GX.sub.--                NumCout)                                                             2c. ∥ PrevPixel = *(LA.sub.-- Prev++=4)                              3a.  CurrPixel =mrc CurrPixel-PrevPixel                                       3b. ∥ GX.sub.-- NumCout = *(GA.sub.-- 1CntTbl+GX.sub.--                       CNTIndex)                                                            3c. ∥ CurrPixel = *(LA.sub.-- Curr++=4)                              4a.  SumABS =mc (SumABS+CurrPixel)& @MF                                         | (SumABS-CurrPixel) &˜@MF                                   4b. ∥ PrevPixel = *(LA.sub.-- Prev ++=4)                           ______________________________________                                    

This loop kernel is preferably controlled using hardware loop logic 720for zero overhead looping in the manner described above.

The complex interactions of these four instructions will be described indetail. In summary, instructions 1a and 3a form the difference betweenpixels of the current frame and pixels of the previous frame and setbits in multiple flags register 211. Instructions 2a and 4a add orsubtract this difference from a running sum of absolute values. Theselection of addition or subtraction is based on the previously set bitswithin multiple flags register 211. The local address unit 620 handlesfetching the pixel data from the corresponding local memory. This datais placed in a memory accessible by the local port of the digitalimage/graphics processor executing this algorithm. Note that the data ispreferably organized as four adjacent 8 bit pixels per 32 bit data word.The global address unit 610 computes the higher order bits in therunning sum of absolute values. This computation of the higher orderbits employs a 256 element look up table and address unit arithmetic.Note that all the data unit operations are multiple operations on 8 bitdata where both the "Msize" field and the "Asize" field of statusregister 210 are set to "100".

Table 52 shows the register assignments used in the example of thisalgorithm listed above. Those skilled in the art would realize thatother register assignments may also be used to perform this same loopkernel.

                  TABLE 52                                                        ______________________________________                                        Register                                                                              Variable Name Data Assignment                                         ______________________________________                                        D0      --            instruction parameters                                    D1 PrevPixel 4 previous frame pixels                                          D2 CurrPixel 4 current frame pixels                                           D3 PrevPixel 4 previous frame pixels                                          D4 CurrPixel 4 current frame pixels                                           D5 SumABS running sum of absolute                                               value of differences                                                        A0 LA.sub.-- Prev previous frame pixel address                                A1 LA.sub.-- Curr current frame pixel address                                 A8 GA.sub.-- CarryCount running sum of carries                                A9 GA.sub.-- 1CntTbl carry count loop up table                                  base address                                                                X0 -- 4                                                                       X8 GX.sub.-- CNTIndex count of carries from                                     multiple flags register                                                     X9 GX.sub.-- NumCout loop up table result                                   ______________________________________                                    

In Table 52: D0 through D5 are data registers in data unit 110; A8 andA9 are address registers in global address unit 610; X8 and X9 are indexregisters in global address unit 610; A0 and A1 are address registers inlocal address unit 620; X0 is an index register in local address unit620.

The data unit operation of instruction 1 of the loop forms thedifference value CurrPixel-PrevPixel. This difference is between thevalues of four pixels of the current frame stored in data register D2and the values of four corresponding pixels of the previous framesstored in data register D1. The "mzc" mnemonic for this instructionindicates: a multiple operation; multiple flags register 211 is zeroedto begin the instruction; and multiple flags register 211 has its leastsignificant bits set by the carry-out results of the multiple sectionsof arithmetic logic unit 230. As previously stated, arithmetic logicunit 230 forms this difference while split into four 8 bit sections. Themultiple flags register 211 has its four least significant bits set fromthe respective carry-outs of the four sections. Note that a "0"carry-out result indicates the difference is negative and a "1"carry-out result indicates the difference is not negative.

Global address unit 610 moves the data stored in multiple flags register211 to index register X8. Note that this move takes place during theaddress pipeline stage of this instruction, which is prior to any dataunit 110 operation. Thus this data is the result of instruction 4 of theprevious loop and not the result of any operation of data unit 110during instruction 1.

Local address unit 620 loads data in the address stored in addressregister A1 into data register D4. This moves data for four pixels ofthe current frame into position for use in instruction 3. Addressregister A1 is pre-incremented and modified by the value in indexregister X0. According to Table 52 this value is "4". Note that it isfeasible to employ a 5 bit offset field for this increment value ratherthan an index register. After this post-increment, address register A1holds the address of the word in memory storing the current four pixelsof the current frame.

Instruction 2 forms the absolute value of the difference and adds thisto a running sum of absolute values. The "mc" mnemonic indicates this isa multiple instruction and that the least significant bits of multipleflags register 211 are set by the respective carry-outs. In this casethe carry-outs replace the four least significant bits set ininstruction 1. Note that the data unit operation (SumABS+CurrPixel)&@MF| (SumABS-CurrPixel)&˜@MF is a readily obtainable arithmetic operationusing the translated function code "10011010" (Hex "9a") as shown inTable 21. The four least significant bits of multiple flags register 211are expended into 32 bits in expand circuit 238 and supplied to input Cbus 243 via multiplexer Cmux 233. This expanded version of the fourleast significant bits of multiple flags register 211 forms the terms onthe "@MF" line in FIG. 47. This forms the absolute value and adds it tothe running sum. Note that if the difference was negative, then thecarry-out bit was "0" and the corresponding expanded multiple flags termis Hex "00". This effectively causes the negative difference to besubtracted from the running sum. On the other hand, if the differencewas positive, the corresponding multiple flags term is Hex "FF" and thedifference is added to the running sum. Using the expanded multipleflags register bits thus enables the formation of the pixel difference,the absolute value and the running sum in only two instructions. Notethat in two cases the sum generates a carry-out. This carry-out isstored in multiple flags register 211 to be used later in computation ofthe higher order bits of the running sum of absolute values.

Global address unit 610 performs address unit arithmetic. The data fromthe higher order bit look up table stored in index register X9 is addedto a running sum of the higher order bits stored in address register A8.Note that the sum of the absolute values of 256 differences of 8 bitpixels may very well overflow the capacity of 8 bits. Thus some mannerof accounting for such overflow bits is needed. Index register X9 holdsthe count of the number of such overflow accumulated in multiple flagsregister 211 during one pass through the loop. Instruction 2b sums theseinto a running sum of these overflow bits, which later forms the higherorder bits of the desired sum of absolute value of differences.

Local address unit 620 loads data in the address stored in addressregister A0 into data register D3. This moves data for four pixels ofthe previous frame into position for use in instruction 3. Addressregister A0 is pre-incremented by the value in index register X0, whichis 4. Address register A0 thus points to the current word of previousframe pixel data. Note that this load operation occurs during theaddress pipeline stage of instruction 2 and is thus available for use inthe execute pipeline stage of instruction 3.

Instruction 3a is similar to instruction 1a. Instruction 3a also forms adifference value (CurrPixel-PrevPixel). This difference is between thevalues of four pixels of the current frame stored in data register D4and the values of four corresponding pixels of the previous framesstored in data register D3. The "mrc" mnemonic for this instructionindicates: a multiple operation; multiple flags register 211 is rotatedto begin the instruction; and multiple flags register 211 has its leastsignificant bits set by the carry-out results of the multiple sectionsof arithmetic logic unit 230. The rotate in multiple flags register 211of the carry-outs formed in instruction 2 occurs at the beginning of theexecute pipeline stage and makes room for storage of four new carry-outsfrom this difference. This rotate in multiple flags register 211 thusretains the carry-outs from the instruction 2.

Global address unit 610 performs a table look up operation. The addressstored in address register A9 is the base address of a 256 element lookup table. Each element in this look up table stores data correspondingto the number of "1's" in the table address. Thus the first element inthe table, having a table address of "00000000", stores "0", the secondelement with a table address of "00000001" stores "1", the third elementwith a table address of "00000010" stores "1", the fourth element with atable address of "00000011" stores "2" and so forth. The index registerX8 stored the carry-outs from the prior pass through the loop as loadedin instruction 1b. Each bit stores the carry-out from a correspondingrunning sum of the absolute value of the differences. A "1" indicatesoverflow of the 8 bit word. The look up table returns the number of such"1's", effectively the sum of the overflow bits. This resultant, whichis stored in index register X9, is added to the running sum of theoverflow bits stored in address register A8 in instruction 2b.

Local address unit 620 loads data in the address stored in addressregister A1 into data register D2. This moves data for four pixels ofthe current frame into position for use in instruction 1 of the nextloop. Address register A1 is pre-incremented and modified by the valuein index register X0, which is "4".

Instruction 4 forms the absolute value of the difference and adds thisto the running sum of absolute values in a manner similar to instruction2. The "mc" mnemonic indicates this is a multiple instruction and thatthe least significant bits of multiple flags register 211 are set by therespective carry-outs, which replace the four least significant bits setin instruction 3. Data unit 110 effectively forms the absolute value andadds it to the running sum. Note that the running sum SumABS Thecarry-outs are stored in multiple flags register 211 to be used later incomputation of the higher order bits of the running sum of absolutevalues.

There is no global address unit operation in instruction 4 in thisexample.

Local address unit 620 loads data in the address stored in addressregister A0 into data register D1. This moves data for four pixels ofthe previous frame into position for use in instruction 1 of the nextpass through the loop. Address register A0 is pre-incremented andmodified by the value in index register X0, which is 4.

Some clean up operations follow after this loop kernel has computed thesum of the absolute value of the differences for an entire 16 by 16pixel block. Once completed data register D5 holds separate sum data infour 8 bit bytes. In addition, address register A8 holds the sum of thehigher order bits of the desired sum of absolute value of differences.To obtain the correct sum the data in the four sections of data registerD5 are added. An arithmetic operation using the translated function code"01100000" (Hex "60"), which is a field addition, is very helpful inthis addition. A method herein called summing 4 bytes into 2 into 1 isdescribed below. This operation starts with partial sum bytes d,c,b,a asfollows in a first data register:

ddddddddccccccccbbbbbbbbaaaaaaaa

Two masks are needed for this operation. The first mask is alternatingHex "00" and Hex "FF" bytes:

00000000111111110000000011111111

This mask could be formed from Hex "0101" stored in Mflags register 211via expand circuit 238 when the "Asize" field indicating a byte datasize. This first mask could also be stored in a data register. Thesecond mask is a Hex "0000FFFF" mask:

00000000000000001111111111111111

This second mask could be formed by mask generator 239 from an input of16. Data register D0 is loaded with a default barrel rotate amount "DBR"field indicating an 8 bit rotate. Once these preliminary steps areaccomplished, then the sum of 4 bytes into 2 bytes into one byterequires only two instructions. In the first instruction the 4 byte sumdata in data register D5 is supplied to both the input A bus 241 viamultiplexer Amux 232 and to barrel rotator 235. The rotation amount isset at 8 bits via the default barrel rotate amount "DBR" field of dataregister D0. The first mask is supplied to input C bus 243 viamultiplexer Cmux 233 and second multiplier input bus 202. This requiresan instruction class field of "001" from Table 39. Arithmetic logic unit230 performs a field addition (A&C)+(B&C). The resultant sum is returnedto the source data register D5. This process is explained as follows.Rotation of the original data by 8 bits yields:

aaaaaaaaddddddddccccccccbbbbbbbb

Arithmetic logic unit 230 effectively masks both the original androtated data and then adds them in two separate fields as controlled bythe first mask. Applying the first mask to the original data yields:

00000000cccccccc00000000aaaaaaaa

Applying the first mask to the rotated data yields:

00000000dddddddd00000000bbbbbbbb

The addition of the these two values results in two 9 bit intermediatesums in a single data word:

0000000uuuuuuuuu00000000vvvvvvvvv

which is stored back into the first source register. Note that theaddition of two 8 bit numbers may yield a 9 bit number as shown above.The power of the three input arithmetic logic unit 230 is shown herewhere the shift, mask and addition are performed in a single cycle ofarithmetic logic unit 230.

The second instruction is similar to the first instruction. In thesecond instruction the partial sum data stored in a data register issupplied to both the input A bus 241 via multiplexer Amux 232 and tobarrel rotator 235. The rotation amount is set at 16 bits via a 5 bitoffset field of "10000" selected by multiplexer Imux 222, supplied tosecond multiplier input bus 202 and selected by multiplexer Smux 231.The second mask is supplied to input C bus 243 via the 5 bit offsetfield selected by multiplexer Imux 222, supplied to second multiplierinput bus 202, selected by multiplexer Mmux 234, formed into the 16 bitsecond mask via mask generator 239 according to Table 19 and furtherselected by multiplexer Cmux 233. This requires an instruction classfield of "011" from Table 39. Arithmetic logic unit 230 performs a fieldaddition (A&C)+(B&C). The resultant sum is returned to the sourceregister. This process is explained as follows. Rotating this partialsum by 16 bits produces:

0000000vvvvvvvvv0000000uuuuuuuuu

Applying the second mask to the original partial sum data yields:

00000000000000000000000vvvvvvvvv

Applying the second mask to the rotated partial sum data mask yields:

00000000000000000000000uuuuuuuuu

The field addition of the these two values results in one 10 bit sum ofthe four byte partial sums:

0000000000000000000000rrrrrrrrrr

which may be stored into the original source data register. Note thataddition of the two 9 bit numbers may overflow into a 10 bit sum.

The final desired sum of the motion estimation process is formed byadding the above four byte partial sum to the running overflow sumrotated left 8 places. A simple rotate and add accomplishes this finaladdition.

This field addition is particularly useful when doing multiplearithmetic. As illustrated above it provides a fast final addition offour partial sums that are initially spread across four bytes, requiringonly two instructions. Because this final addition is fast, digitalimage/graphics processor multiple arithmetic can have a speed advantageover single-byte arithmetic even when only a small number of additionsare needed to provide the partial sums. This method is particularlyuseful in the clean up of the sum of absolute value of differencesdescribed above.

Suitable outer loops are needed to supplement this loop kernel. By wayof example only, a suitable outer loop could so load the pixel data forthe current and previous frame that an entire 16 by 16 pixel block maybe handled without interrupting the inner loop. Alternatively, outerloops insure proper registration of the pixel data when employing theinner loop. Displacement of the 16 by 16 pixel blocks are also handledby larger loops. Larger loops also make the selection of the motionvector for each pixel is based upon the least sum of absolute value ofdifferences. All these program features are within the capability of oneskilled in the art. Note that these outer loops are executed much lessfrequently, therefore maximum coding density is not as important than inthe inner loop kernel listed above.

Another function used in the proposed MPEG encoding standard is variablelength codes. This is often called Huffman encoding. Huffman encodinghas many other uses in addition to video encoding. Variable length codesare employed for discrete data elements to be transmitted. In order toreduce the amount of data to be transmitted, more frequently used datais encoded using fewer bits.

Huffman variable length encoding specifies both encoding and decodingtechniques. In an application such as multimedia computing, the softwaremedia vendor performs the encoding. The user's computer decodes theencoded data when used. In this event, large computing resources can beemployed during encoding or the encoding may be performed taking longerthan the real time length of the video sequence. This is feasible sinceencoding is done only once. Thus in such applications only decoding needbe done in real time. In other applications such as video conferencingboth encoding and decoding must be done in real time by the user'sapparatus.

An example of such variable length coding is shown in Table 53 below.Each coded number consists of a size field and a value field. Table 53shows an example using a 2 bit size field and a value field of up to 3bits.

                  TABLE 53                                                        ______________________________________                                        Size          Value  Encoded Number                                           ______________________________________                                        00            --     0                                                        01            0      -1                                                         01 1 1                                                                        10 00 -3                                                                      10 01 -2                                                                      10 10 2                                                                       10 11 3                                                                       11 000 -7                                                                     11 001 -6                                                                     11 010 -5                                                                     11 011 -4                                                                     11 100 4                                                                      11 101 5                                                                      11 110 6                                                                      11 111 7                                                                    ______________________________________                                    

Table 53 shows only some examples of Huffman encoding. Othercombinations of the number of size bits and the number of value bits arefeasible. Table 54 shows the range of numbers which can be encoded withvarious numbers of size bits and numbers of value bits.

                  TABLE 54                                                        ______________________________________                                        Number of Number of                                                             Size Bits Value Bits Range of Encoded Numbers                               ______________________________________                                        1         0        0                                                            1 1 -1, 1                                                                     2 0 0                                                                         2 1 -1, 1                                                                     2 2 -3, -2, 2, 3                                                              2 3 -7 to -4, 4 to 7                                                          3 0 0                                                                         3 1 -1, 1                                                                     3 2 -3, -2, 2, 3                                                              3 3 -7 to -4, 4 to 7                                                          3 4 -15 to -8, 8 to 15                                                        3 5 -31 to -16, 16 to 31                                                      3 6 -63 to -32, 32 to 63                                                      3 7 -127 to -64, 64 to 127                                                    4 0 0                                                                         4 1 -1, 1                                                                     4 2 -3, -2, 2, 3                                                              4 3 -7 to -4, 4 to 7                                                          4 4 -15 to -8, 8 to 15                                                        4 5 -31 to -16, 16 to 31                                                      4 6 -63 to -32, 32 to 63                                                      4 7 -127 to -64, 64 to 127                                                    4 8 -255 to -128, 128 to 255                                                  4 9 -511 to -256, 256 to 511                                                  4 10 -1023 to -512, 512 to 1023                                               4 11 -2047 to -1024, 1024 to 2047                                             4 12 -4095 to -2048, 2048 to 4095                                             4 13 -8191 to -4096, 4096 to 8191                                             4 14 -16383 to -8192, 8192 to 16383                                           4 15 -32768 to -16384, 16384 to 32768                                       ______________________________________                                    

Thus a single bit size permits only up to one bit for value and canencode -1, 0 and 1. A two bit size permits the value to be representedby up to 3 bits and can encode from -7 to 7. A 3 bit size permits up to7 bits for value and can encode from -127 to 127. If size is encoded in4 bits, then the value can have up to 15 bits and can encode from -32768to 32768. For any particular application of Huffman encoding the numberof size bits is constant. The number of value bits is selected toprovide a range including the number to be encoded. From Table 54 it isclear that numbers near zero require fewer bits to encode than numbersfurther from zero. The raw data is preferably quantized or otherwiseselected or manipulated so that numbers near zero occur more frequentlythan numbers distant from zero. Thus the more frequently encountereddata requires fewer bits to encode. This feature reduces the averagenumber of encoded bits that must be transmitted or stored.

An algorithm for Huffman encoding a sample appears below. This exampleassumes a range of values to be encoded from algorithm presupposes thatthe range of numbers is from -2047 to 2047 represented by 12 bits. Thesenumbers are right justified in sign extended 32 bit words. Note thatconversion from packed signed extended 16 bit data can be accomplishedusing sign extended half word memory loads or register to registermoves, or using half word masks coupled with rotation of 16 bit datalocated in the most significant bits of a 32 bit word. Inspection ofTable 54 indicates this range of numbers can be encoded using 4 sizebits and up to 10 value bits. Thus the data length of the Huffmanencoded data may vary from 4 to 14 bits.

This example includes the following steps: forming the absolute value,determining the size via left most "1" detection; generation of thevalue bits for negative numbers; and packing the size and value.

    ______________________________________                                        1.            RawData = RawData                                                 2a.  AbsValue =[.n] 0 - RawData                                               2b. ∥ AbsValue =[ge] RawData                                         3.  Size =[.n] LMO AbsValue                                                   4.  Value =[n] RawData + %Size                                                5.  RotSize = Size \\ Size                                6.  SizeValue = RotSize & ˜%Size | Value & %Size             ______________________________________                                    

Table 55 shows the register assignments in this example of Huffmanencoding.

                  TABLE 55                                                        ______________________________________                                        Register                                                                              Variable Name  Data Assignment                                        ______________________________________                                        D1      RawData        raw data to be encoded                                    Value corrected value portion                                                  of encoded data                                                             D2 AbsValue absolute value of raw data                                         RotSize rotated data size portion                                              of encoded data                                                             D3 Size data size portion of                                                    encoded data                                                                D4 SizeValue packed encoded data                                            ______________________________________                                    

Instruction 1 sets the status bits stored in status register SR 210. Thenegative "N" bit will be used in two later instructions. Instruction 2forms the absolute value of RawData. Note the register to register moveoperation has priority over the arithmetic logic unit operation. IfRawData ≧0, then the register move takes place according to the greaterthan or equal to "ge" mnemonic and AbsValue is set to RawData. IfRawData <0, then the register move does not take place and thearithmetic logic unit operation takes place. This priority of operationis in accordance with Table 51. Thus AbsValue is set to 0-RawData. Thiseffectively sets Absvalue to the absolute value of RawData. Note the".n" mnemonic in instruction 2a preserves the status of the negative "N"status bit regardless of the results of the arithmetic logic unitoperation.

Instruction 3 determines the size of the original data. Instruction 3employs LMO/RMO/LMBC/RMBC circuit 237 to determine the left most one inAbsValue. This is the most significant bit in the raw data. The valuereturned by LMO/RMO/LMBC/RMBC circuit 237 in the form shown in Table 16yields the number of significant bits in the raw data, thus the desiredsize portion of the encoded number. The absolute value formed ininstruction 2 ensures that this left most one operation generates thecorrect result for negative numbers. The ".n" mnemonic preserves thestatus of the negative "N" status bit. This same result can be achievedby replacing instructions 2 and 3 with Size =[.n] LMBC RawData.LMO/RMO/LMBC/RMBC circuit 237 would detect the most significant "1" forpositive data and the most significant "0" for negative data. The formlisted above may be preferred if the algorithm requires more datatransfer operations.

Instruction 4 corrects the RawData into the Huffman form as shown inTable 54. Note that Value and RawData are the same register according toTable 55. Thus if RawData is greater than or equal to zero, thecondition of instruction 4 fails and Value is RawData. If RawData isless than zero according to the "n" mnemonic, then the addition takesplace. This realizes the encoding of negative numbers of the form shownin Table 53.

Instructions 5 and 6 form packed data including the size and value.Instruction 5 rotates Size by the previously determined number of bitsof value. Instruction 6 merges these into a single data word. Note thatany practical implementation of such Huffman encoding would requireadditional data handling operations. These would be required to inputthe raw data and to pack complete data words of encoded data and outputthese packed words. These functions are known in the art and will not bedescribed in detail.

A simplified example of Huffman decoding on the multiprocessorintegrated circuit of this invention is described below.

    ______________________________________                                        1.            L.sub.-- WordAddressX = BitAddress >>u 5                          2.  Nop                                                                       3.  ThisWord = *(L.sub.-- WordAddressBase                                       += [L.sub.-- WordAddressX])                                                 4a.  AlignedWord = ThisWord << BitAddress                                     4b. ∥ NextWord = *(L.sub.-- WordAddressBase + [1])                   5.  Cur32Bits = AlignedWord & ˜%BitAddress                                | NextWord \\ BitAddress & %BitAddress                      6a.  L.sub.-- HuffLUTX = Cur32BIts >>u 26                        6b. ∥ Dummy0000 = &*(L.sub.-- WordAddressBase                          -= [L.sub.-- WordAddressX])                                                 7.  Nop                                                                       8.  UsedBits =sb *(L.sub.-- BitsUsedAddress                                     + [L.sub.-- HuffLUTX])                                                      9a.  BitAddress = BitAddress + UsedBits                                       9b. ∥ L.sub.-- BitsUsedAddress = *(G.sub.-- Space                      + O.sub.-- AC.sub.-- BitsUsedAddress)                                       9c. ∥ RunSize =ub *(L.sub.-- RunSizeAddress                            + [L.sub.-- HuffLUTX])                                                    HuffmanLoopStart:                                                               Jump.sub.-- Back.sub.-- In:                                                     10a.          WordAddress = BitAddress >> 5                                 10b. ∥ BR =[c] *(G.sub.-- Space + O.sub.-- ExtendedTableDecode)      11a.  PosOffset = 0 - (RunSize \\ 28 & %28) + cin                          11b. ∥ L.sub.-- WordAddressX = WordAddress                           11c. ∥ FunctionEalu = *(L.sub.-- Space +                            Tealu.sub.-- Function)                                        12a.  FieldSize = FunctionEalu | (RunSize & %4)                      12b. ∥ LC1 = RunSize                                                 13a.  G.sub.-- OffsetX = G.sub.-- OffsetX + PosOffset                         13b. ∥ ThisWord = *(L.sub.-- WordAddressBase                           += [L.sub.-- WordAddressX])                                                 14a.  AlignedValue = EALU(D1, Cur32Bits \\ UsedBits,        %FieldSize)                                                                 14b. ∥ LC1 =[le] A15                                                 15a.  AlignedWord = ThisWord << BitAddress                                    15b. ∥ G.sub.-- ZigZagDCTX =ub *(G.sub.-- ZigZagLUTop                  - [G.sub.-- Offset])                                                        15c. ∥ NextWord = *(L.sub.-- WordAddressBase + [1])                  16a.  Cur32Bits = AlignedWord & ˜%BitAddress                              | NextWord \\ BitAddress & %BitAddress                          16b. ∥ L.sub.-- RunSizeAddress = *(G.sub.--                         Space                                                           + O.sub.-- AC.sub.-- RunSizeAddress)                                        16c. ∥ Bit31 = *(L.sub.-- Space + tBit31)                            17a.  Dummy0001 = AlignedValue & (Bit31 \\ FieldSize                      )                                                             17b. ∥ L.sub.-- HuffLUTX =ub3 Cur32Bits                              17c. ∥ Dummy0003 = &*(L.sub.-- WordAddressBase                         -=[L.sub.-- WordAddressX])                                                  18a.  AdjustedValue =[z] AlignedValue - %FieldSize                            18b. ∥ QuantStep =h *(G.sub.-- QuantizationTable                       - [G.sub.-- OffsetX]                                                        19a.  IDCTValue = QuantStep * AdjustedValue                                   19b. ∥ UsedBits =sb *(L.sub.-- BitsUsedAddress                         + [L.sub.-- HuffLUTX])                                                    End.sub.-- of.sub.-- Tight.sub.-- Loop:                                           20a.          BitAddress = BitAddress + UsedBits                            20b. ∥ *(G.sub.-- IDCTBase + [G.sub.-- ZigZagDCTX]) =h                               IDCTValue                                                     20c. ∥ RunSize =ub *(L.sub.-- RunSizeAddress                           + [L.sub.-- HuffLUTX])                                                    ______________________________________                                    

Table 56 shows the data register assignments employed in this example ofthe Huffman decode algorithm.

                  TABLE 56                                                        ______________________________________                                        Register                                                                              Variable Name   Data Assignment                                       ______________________________________                                        D0      FieldSize       number of bits in                                         value field                                                                  FunctionEalu extended arithmetic                                               logic function code                                                         D1 BitAddress bit address of next                                               bit to decode                                                               D2 AlignedWord data word containing                                             next bit in most                                                              significant bit                                                              Cur32Bits data word containing                                                 next 32 bits of data                                                        D3 Dummy0000 register set but                                                   not used                                                                     AlignedValue stripped aligned value                                           AdjustedValue negative corrected                                               decoded value                                                                IDCTValue dequantized value ready                                              for inverse discrete                                                          cosine transform                                                              operation                                                                    WordAddress base address of word                                               including first bit                                                           to decode                                                                   D4 NextWord following data word                                                Dummy0001 register set but                                                     not used                                                                     UsedBits total number of bits                                                  used by Huffman code                                                          and encoded value                                                            Bit31 Hex "80000000"                                                         D5 ThisWord data word containing                                                next bit to decode                                                           Dummy0003 register set but                                                     not used                                                                     QuantStep quantization multiplier                                            D6 RunSize packed size of field                                                 and zero run length                                                           (4 bits each)                                                               D7 PosOffset run length of zeros                                                plus 1                                                                    ______________________________________                                    

Table 57 lists proposed address register assignments for implementingthis example of a Huffman decode algorithm.

                  TABLE 57                                                        ______________________________________                                        Address                                                                         Register Variable Name Data Assignment                                      ______________________________________                                        A0      L.sub.-- Space   pointer to local                                         scratchpad memory                                                           A1 L.sub.-- BitsUsedAddress base address for                                    bits used                                                                   A2 L.sub.-- WordAddressBase base address of word                                containing the                                                                first bit to decode                                                         A3 L.sub.-- RunSizeAddress base address of                                      size/run                                                                    A8 G.sub.-- QuantizationTable quantization table                                base address                                                                A9 G.sub.-- IDCTBase base address of 8                                          by 8 output block                                                           A10 G.sub.-- ZigZagLUTop address register                                       zig-zag scan table                                                            look-ups                                                                    A11 G.sub.-- Space pointer to global                                            scratchpad memory                                                         ______________________________________                                    

Table 58 lists proposed index register assignments for implementing thisexample of a Huffman decode algorithm.

                  TABLE 58                                                        ______________________________________                                        Index                                                                           Register Variable Name Data Assignment                                      ______________________________________                                        X0      L.sub.-- WordAddressX                                                                        address word containing                                    next bit to decode                                                          X1 L.sub.-- HuffLUTX offset address for Huffman                                 look-up table                                                               X8 G.sub.-- OffsetX index register for zig-zag                                  scan table look-ups                                                         X10 G.sub.-- ZigZagDCTX index register for zig-zag                              scan table look-ups                                                       ______________________________________                                    

This example of Huffman decoding includes two parts. Instructions 1 to 9involve initial loop set up. This portion of the program also deals withan initial DC term which has a size of 6 bits. Instructions 10 to 20form a loop for decoding the stream of Huffman encoded data. These areAC terms and include a run value of 4 bits and a size value of 4 bits.Each pass through the loop decodes one instance of Huffman encoded data.Note that instructions 1 to 9 do not include the necessary loop set upfor the loop including instructions 10 to 20. This is accomplished in amanner previously described.

Instruction 1 sets a word address index L₋₋ WordAddressX. The algorithmkeeps a bit address BitAddress which points to the next bit to bedecoded. Instruction 1 sets L₋₋ WordAddressX as BitAddress right rotated5 bits. Thus BitAddress is divided by 2⁵ =32 to obtain the address ofthe next 32 bit word. The Nop of Instruction 2 is required by thepipeline so that the value of L₋₋ WordAddressX set in the executepipeline stage of instruction 1 is available during the address pipelinestage operation of instruction 3.

Instruction 3 loads the data word including the next bit to be decoded.Instruction 3 is a local address unit operation. A register is loadedfrom the memory location equal to the sum of a base address L₋₋WordAddressBase and the just computed index address L₋₋ WordAddressX.The syntax of this instruction indicates that L₋₋ WordAddressX as scaledto the selected data size is pre-added to L₋₋ WordAddressBase, which ismodified by the addition.

Instruction 4a forms an aligned version of the next bits to be decoded.ThisWord just loaded from memory contains the next bit to be decoded.The left rotate by the value BitAddress aligns the next bit to bedecoded into bit 31 of AlignedWord, the most significant bit. Note thatonly the five least significant bits of BitAddress are used by thehardware of data unit 110 in this rotate operation. Thus the rotate islimited to the range of 31 bits. Instruction 4b is a local address unitoperation. Instruction 4b loads the next data word in memory followingThisWord. Note that the base address of L₋₋ WordAddressBase was set tothe address of ThisWord in instruction 3. Thus L₋₋ WordAddressBase plus1 scaled to the data size is the address of the next data word.

Instruction 5 forms Cur32Bits as the next 32 bits to be decoded.Cur32Bits differs from AlignedWord because AlignedWord probably includesless than 32 of the next bits to be decoded. AlignedWord is masked withthe inverse of BitAddress. This mask ˜%BitAddress has a number of leastsignificant "0's" equal to the number of the five least significant bitsof BitAddress with the most significant bits equal to "1's". This ANDedwith AlignedWord selects the next following data to be decoded. The mask%BitAddress has a number of least significant "1's" equal to the numberof the five least significant bits of BitAddress with the mostsignificant bits of this mask equal to "0's". NextWord is left rotatedby the number of the five least significant bits of BitAddress. The ANDthus selects the number of most significant bits of Nextword to fill the32 bits of Cur32Bits.

Instruction 6a sets an address index L₋₋ HuffLUTX. Instruction 6a is anunsigned right rotate of Cur32Bits by 26 places. This puts the 6 mostsignificant bits of Cur32Bits into the 6 least significant places andzero fills the remaining places. The address index L₋₋ HuffLUTX is usedas an index into a look-up table. Instruction 6b resets the address L₋₋WordAddressBase in an address arithmetic operation. The syntax ofinstruction 6b pre-subtracts L₋₋ WordAddressX as scaled by the data sizefrom L₋₋ WordAddressBase. This reverses the base address modification ofinstruction 3. The address register is modified in this way because itmakes loading NextWord easier. Without such modification of L₋₋WordAddressBase by L₋₋ WordAddressX, computing the address of Next Wordwould require an arithmetic unit operation an consequent delay slotsbefore the computed address could be used in the load operation. This isan example where using address arithmetic saves operations. Note thatthe same net operation could be achieved using a memory load intoDummy0000. An actual memory load operation is not used in this exampleto reduce the possibility of memory contention at crossbar 50. The Nopof instruction 7 is required by the pipeline so that the value of L₋₋HuffLUTX set in the execute pipeline stage of instruction 6 is availableduring the address pipeline stage operation of instruction 8.

Instruction 8 is a local address unit operation. This is a look-up tableoperation using a base address of L₋₋ BitsUsedAddress and an index ofL₋₋ HuffLUTX scaled to the data size. The load operation is a signedbyte operation according to the "sb" mnemonic. UsedBits is set to a signextended byte equal to the data stored at the address of the sum of L₋₋BitsUsedAddress and L₋₋ HuffLUTX scaled to the data size. This look-uptable operation converts the next 6 bits to be decoded into a number ofbits used, expanding the size quantity into the sum of the run, size andvalue bits.

Instruction 9a updates BitAddress by adding the just determinedUsedBits. Instruction 9b loads into L₋₋ BitsUsedAdddress an addressstored in a global scratchpad memory at location O₋₋ AC₋₋BitsUsedAddress. This address is the address of the beginning of alook-up table. Note that O₋₋ AC₋₋ BitsUsedAddress is not an indexregister but rather a code for a short offset value. This Instruction 9cloads RunSize. This unsigned byte load (mnemonic "ub") is from a look-uptable having a base address L₋₋ RunSizeAddress and a location equal tothe index L₋₋ HuffLUTX scaled to the data size. Thus the index L₋₋HuffLUTX serves as an index into two tables, a first to determineUsedBIts (instruction 8) and a second to determine RunSize.

A loop used for Huffman decoding starts at instruction 10, which isgiven the labels HuffmanLoopStart and Jump₋₋ Back₋₋ In. Many of thesteps previously described in the start up portion of the program arerepeated within the loop. Instruction 10a sets WordAddress equal toBitAddress right shifted 5 places. This converts a bit address into aword address in a manner previously described regarding instruction 1.Instruction 10b is a branch instruction. The branch destination isstored in a location corresponding to O₋₋ ExtendedTableDecode within theglobal scratchpad memory starting at G₋₋ Space. Note O₋₋ExtendedTableDecode is an instruction specified short offset value. The"c" mnemonic indicates this branch is taken if the arithmetic logic unitoperation BitAddress=BitAddress+UsedBits generates a carry output. Notethat this arithmetic logic unit operation setting the carry output isthe same for initial entry into the loop via instruction 9 and return tothe loop start from instruction 20. This branches the program out ofthis loop for the case in which the space for storing the next bits tobe decoded, which are pointed to by BitAddress, is exceeded. The programcontinues from the location stored at O₋₋ ExtendedTableDecode to reusethe memory holding the next bits to be decoded by loading additionalbits from another memory. Once this house keeping is complete, theprogram returns to instruction 10 via the label Jump₋₋ Back₋₋ In.

Instruction 11a computes PosOffset. RunSize is left rotated 28 bits andmasked by a mask having bits 31 to 28 all "0's" and bits 27 to 0 havingall "1's" (%28). This effectively right shifts RunSize by 4 bits. Notethat this particular manner of generating the right shift takesadvantage of a 5 bit offset value setting both the rotate amount and themask input. Since cin is set by the arithmetic logic unit operation ofthe previous instruction, which is only a rotate operation, cin isalways "1". Thus PosOffset is set equal to one more than 0-Run.Instruction 11b sets the index register L₋₋ WordAddressX equal to thepreviously computed value WordAddress. This technique sets L₋₋WordAddressX rather than directly setting this register as ininstruction 1 because the direct setting of the non-data registerrequires global port source bus Gsrc 105 and global port destination busGdst 107 is inconsistent with the condition branch instruction ininstruction 10b. Instruction 11c loads data register D0 with a code usedin a later extended arithmetic logic unit operation. This code is storedin the local scratchpad memory at a location corresponding to an offsetvalue Tealu₋₋ Function.

Instruction 12a modifies the extended arithmetic unit operation codestored in data register D0. FieldSize, which is also stored in dataregister D0, is replaced with the AND of the just recalled FunctionEaluand the four least significant bits of RunSize. These are extracted withthe mask %4. This extracts the size from RunSize and stores it in thedefault barrel rotate amount field "DBR" of data register D0. Thus thedefault barrel rotate amount in the later extended arithmetic logic unitoperation is set by this merge instruction. To facilitate this merge,the data stored in bits 4 to 0 at index Tealu₋₋ Function within thelocal scratchpad memory should be "00000".

Instruction 12b sets the loop counter LC1 equal to RunSize. In the MPEGstandard blocks of graphic data are transformed via a discrete cosinetransform (DCT). This transformation converts the pixel data into twodimensional frequency data. The two dimensional frequency data isscanned via a zig-zag pattern from low frequency data to high frequencydata. This moves low frequency data into the first transformed valuesand high frequency data into later transformed values. Most graphicblocks will have a minimum of high frequency data. This means that manyof the transformed data values will be near zero and suitable forencoding according to the technique shown in Table 54. Thistransformation also means that in most instances a point in the datastream will be reached where the remaining transformed values are allzero. In the MPEG standard this state is signaled by a RunSize value of"00000000". When such a RunSize value is found, then an entire block ofdata is decoded and the loop should be re-initialized. Thus if RunSizeis an end of block marker equal to "00000000", then the loop count iszero and the loop is not re-entered.

Instruction 13a updates the value of G₋₋ OffsetX. G₋₋ OffsetX determinesif all 64 bins of a block have been used. Note this would only occur ifthe last bin were nonzero. Otherwise a RunSize of zero would be the lastdata for a block. The index G₋₋ OffsetX stores the accumulated runs ofRunSize via PosOffset. Since PosOffset is negative, G₋₋ OffsetX becomesless than or equal to zero when the 64 bins of a block are complete.Note that the additional 1 in PosOffset is needed to insure that eachinstance of a bin value is counted. Instruction 13b loads the data wordincluding the next bits to be decoded into ThisWord in the same manneras instruction 3.

Instruction 14a is an extended arithmetic logic unit operation. Thisinstruction performs the logic operationAlignedValue=Cur32Bits\\UsedBits&%FieldSize. The left rotate ofCur32BIts by UsedBits replaces the next bits to be decoded from the mostsignificant bits to the least significant bits. This is masked byFieldSize. This aligns the value portion of the next bits to be decodedinto the least significant bits of AlignedValue. Instruction 14b setsthe loop count in LC1 to "0" from the zero value address register A15 ifthe arithmetic logic unit operation of instruction 13a generates aresult less than or equal to zero according to the "le" mnemonic. Aspreviously discussed, this indicates that an entire block has beendecoded and thus the loop should be exited.

Instruction 15a is similar to instruction 4a. This places the next bitsto be decoded from ThisWord into the most significant bits ofAlignedWord. Instruction 15b sets an index G₋₋ ZigZagDCT from a look-uptable starting at the address stored in G₋₋ ZigZagLUTop based upon thepreviously computed index value G₋₋ Offset. As previously stated theMPEG encoding technique involves standard blocks of graphic datatransformed via a discrete cosine transform (DCT). Decoding requirescomputation of an inverse discrete cosine transform (IDCT). The order ofuse of the decoded values depends upon the algorithm computing theinverse discrete cosine transform. Use of the look-up table starting atthe address of G₋₋ ZigZagLUTop, enables a single look-up table to handlea zig-zag scan pattern as well as this preferred ordering of componentsfor the inverse discrete cosine transform algorithm. Instruction 15cloads NextWord from memory in the same manner as previously described atinstruction 4b.

Instruction 16a is similar to instruction 5. This instruction formsCur32Bits as a full 32 bit word with the next bit to be decoded to inthe most significant bit. Instruction 16b is a global memory load. Theaddress L₋₋ RunSizeAddress is loaded with the value from the globalscratchpad memory pointed to by offset value O₋₋ AC₋₋ RunSizeAddress.Instruction 16c sets Bit31 equal to the data stored in the localscratchpad memory at a location indicated by offset tBit31. Inaccordance with this example, the data at this address is Hex"80000000", or bit 31 set to "1" and all other bits "0". This is used ina masking operation to be described below.

Instruction 17a performs a test on the data of AlignedValue.AlignedValue is ANDed with Bit31 (Hex "8000000") as left rotated byFieldSize. Bit31 as left rotated by FieldSize sets a "1" at the mostsignificant bit of the value stored in AlignedValue. As evident from theexamples of Table 54, negative values have a "0" in this location andpositive values have a "1" in this location. Thus if the encoded valueis negative, then the result is zero and the "Z" bit of status registerSR 210 is set. If the encoded value is positive, then the result isnonzero and the "Z" bit of status register SR 210 is not set. Asindicated by the register designation Dummy0001, the data stored in thedestination register is never used. This instruction only sets thestatus bits in status register SR 210. Instruction 17b performs afunction similar to instruction 6a. Instruction 17b loads L₋₋ HuffLUTXwith the third unsigned byte of Cur32Bits. Note that the DC term handledin instruction 6a had 6 size bits, while the AC term handled ininstruction 17b includes a byte consisting of 4 run bits and 4 sizebits. Instruction 17c is an address arithmetic instruction whichrecovers the base word address stored in L₋₋ WordAddressBase. This issimilar to instruction 6b.

Instruction 18a used the zero status bit "Z" set in instruction 17a.AdjustedValue is replaced with the difference of AdjustedValue and amask of FieldSize if the result of instruction 17a was zero. Thus if theencoded value is negative it is subtracted from constant having a numberof "1's" equal to the field size. Inspection of Table 53 indicates thatthis subtraction recovers the encoded number in signed form. Note ininstruction 17a that AlignedValue and AdjustedValue are assigned thesame data register D3, thus the data is unchanged if the test fails.Instruction 18b is a memory load operation. QuantStep is loaded with aquantization multiplier constant corresponding to the current bin of the64 bins of a data block. This quantization multiplier constant is storedin a look-up table beginning at the address stored in G₋₋QuantizationTable at a location corresponding to the value of index G₋₋OffsetX. Note that G₋₋ OffsetX is set at instruction 13a and correspondsto the current bin.

Instruction 19a is a multiplication operation. The product of the justloaded QuantStep and AdjustedValue determines IDCTValue. IDCTValue is adequantized value ready for inverse discrete cosine transform. This isthe desired result of the Huffman decode operation. Instruction 19bupdates the value of UsedBits in the same manner as instruction 8.

Instruction 20 is the last instruction of the loop and is labeled End₋₋of₋₋ Tight₋₋ Loop. Instruction 20a updates BitAddress in the samefashion as instruction 9a. Note that the carry of this operationdetermines whether the conditional branch is taken at instruction 10bfor the next iteration of the loop. Instruction 20b stores the justdetermined value of IDCTValue in a variable table starting at theaddress of G₋₋ IDCTBase. The index G₋₋ ZigZagDCTX which selects thelocation within this table was set in instruction 15b based upon thecurrent bin stored in G₋₋ OffsetX. Thus the decoded value is stored inthe order optimal for the inverse discrete cosine transform algorithm.Note the "h" mnemonic indicates that this is a half word or 16 bit datatransfer. Instruction 20c loads RunSize in the same fashion asinstruction 9c.

The loop of instruction 10 to 20 repeats until encountering one of threeexits. If BitAddress+UsedBits generates a carry, the instruction 10bbranches to another program sequence to handle loading additional data.Generally, once new data is loaded this loop will be re-entered atinstruction 10, label Jump₋₋ Back₋₋ In. The loop exits when an end ofblock RunSize of "00000000" occurs. This indicates the end of a block ofdata. The loop also exits when G₋₋ OffsetX is decremented to zero viaPosOffset.

Another widely used operation in graphics processing is the mean squarederror. Mathematically this is expressed as: ##EQU7## A straight forwardapproach involves two nested loops forming the summations into a runningsum. The division by the product of n and m takes place following thecompletion of the nested loops. The kernel includes forming thedifference and the square and the data move operations to transfer datafrom memory 20 to the data registers of the particular digitalimage/graphics processor 71, 72, 73 or 74. This process is similar tothe process noted above with respect to the sum of the absolutedifference values.

Such a straight forward approach may not use the hardware resources withthe greatest efficiency. Multi-processor integrated circuit 100 mayprovide several techniques for performing the same function. As examplesonly, address unit arithmetic may replace arithmetic operationsemploying data unit 110 or register-to-register moves with fieldextraction and sign/zero extension may replace mask and rotateoperations employing data unit 110. In many cases these alternateoperations involve differing characteristics in precision supported,timing and availability of intermediate results and the like. As anexample, multiple arithmetic can greatly speed many operations, if thealgorithm needs only the reduced number of bits available. Suppose as anexample that the quantities x and y are only eight bit values. Usingmultiple arithmetic to simultaneously form four differences may resultin a 9 bit difference with the borrow term formed as the section carryoutput. This ninth bit can be stored in multiple flags register 211 forlater use. Note that the square of the difference is the same as thesquare of the absolute value of the difference. Thus it is possible tolimit the differences formed to 8 bits using the absolute valuetechnique described above. Then multiplier 220 can perform a multiple 8by 8 multiply to form two squares simultaneously. The lower two bytesare properly positioned for such a multiple multiply operation. Theupper two bytes may be extracted and positioned using either barrelrotator 235 or field extract/extend moves. Two running sums are formed,one for the upper byte differences and one for the lower bytedifferences. The squared error terms are 16 bits, therefore 32 bits areneeded to store these running sums. As in the case of the sum ofabsolute difference values described above, the two running sums areadded during wrap up.

An inner loop kernel for the mean squared error algorithm is listedbelow.

    ______________________________________                                        1a.           Err =mc CurrBlk-PredBlk                                           1b. ∥ LX.sub.-- SqErro =uh0 Sq.sub.-- ErrA                           1c. ∥ Dummy = &*(LA.sub.-- SumA+=LX.sub.-- SqErr2)                   2a.  ABS.sub.-- Err =m (0+Err)& @MF                                             | (0-Err)&˜@MF                                               2b. ∥ LX.sub.-- SqErr1 =uh1 Sq.sub.-- ErrA                           2c. ∥ CurrBlk =w *LA.sub.-- Curr                                     3a.  SQ.sub.-- ErrA =mu ABS.sub.-- Err * ABS.sub.-- Err                       3b. ∥ ABS.sub.-- ErrB = EALUT(Hex "00", ABS.sub.-- Err)                           3c. ∥ LX.sub.-- SqErr2 =uh0 SQ.sub.-- ErrB                           3d. ∥ Dummy = &*(LA.sub.-- SumA+=LX.sub.--                          SqErr0)                                                           4a.  Sq.sub.-- ErrB =mu ABS.sub.-- ErrB * ABS.sub.-- ErrB                     4b. ∥ MSE.sub.-- SumB = EALUT(MSE.sub.-- SumB, Sq.sub.-- ErrB)       4c. ∥ PredBlk =w *GA.sub.-- Pred                                     4d. ∥ Dummy = &*(LA.sub.-- SumA+=LX.sub.-- SqErr1)                   5a.  LX.sub.-- SqErr0 =uh0 Sq.sub.-- ErrA                                     5b. ∥ Dummy = &*(LA.sub.-- SumA+=LX.sub.-- SqErr2)                   6.  LX.sub.-- SqErr1 =uh1 Sq.sub.-- ErrA                                      7a.  LX.sub.-- SqErr2 =uh0 Sq.sub.-- ErrB                                     7b. ∥ Dummy = &*(LA.sub.-- SumA+=LX.sub.-- SqErr0)                 ______________________________________                                    

Table 59 shows the register assignments used in the example of thisalgorithm listed above. Those skilled in the art would realize thatother register assignments may also perform this same loop kernel.

                  TABLE 59                                                        ______________________________________                                        Register                                                                              Variable Name   Data Assignment                                       ______________________________________                                        D0                      default rotate amount 16                                D1 MSE.sub.-- SumB second running sum                                         D2 Sq.sub.-- ErrB second squared error                                        D3  Hex "00000000"                                                            D4 ABS.sub.-- Err absolute value of error                                      Sq.sub.-- ErrA first squared error                                           D5 dummy unused result                                                         PredBlk preceding block value                                                D6 CurrBlk current block value                                                D7 ABS.sub.-- ErrB second absolute error                                       Err error difference                                                         A0 LA.sub.-- SumA first sum address                                           A1 LA.sub.-- Curr current block address                                       A8 GA.sub.-- Pred preceding block address                                     X0 LX.sub.-- SqErr0 first square error index                                    address                                                                      LX.sub.-- SqErr2 second square error index                                     address                                                                     X1 LX.sub.-- SqErr1 third square error index                                    address                                                                   ______________________________________                                    

In Table 59: D0 through D7 are data registers in data unit 110; A8 is anaddress register in global address unit 610; A0 and A1 are addressregisters in local address unit 620; X0 and X1 are index registers inlocal address unit 620.

The data unit operation of the first instruction (1a) forms thedifference between the current block value CurrBlk and the precedingblock value PredBlk. The "mc" mnemonic indicates this is a multipleoperation and that the carries are stored in multiple flags register211. In this example, there are four eight bit subtracts taking placesimultaneously. The global address unit operation of the firstinstruction (1b) loads the first byte of the first squared error intoindex register X0. Note that the mnemonic "uh0" indicates that this loadoperation extracts the first byte (byte 0) into a half word (16 bits) ofthe destination with zero extension. The local address unit operation ofthe first instruction (1c) performs an address unit arithmeticoperation. The "+=" operator indicates that this address unit operationemploys pre-addition of the index register to modify the base addressregister. This operation adds a second squared error term LX₋₋ SqErr1stored in index register X0 to a running sum stored in address registerA0. Note that the destination register D5 is a dummy and the data isstored in the modified address register A0.

The data unit operation of the second instruction (2a) forms theabsolute value of the differences. Note that the carry-outputs stored inmultiple flags register 211 controls whether the addition or thesubtraction takes place. The "m" mnemonic indicates that this is amultiple operation, thus individual bits from multiple flags registercontrol corresponding multiple sections. As explained above, thisabsolute value restricts the difference to eight bits enabling an 8 bitby 8 bit split multiply operation, thereby doubling the speed ofcomputation over a 16 bit by 16 bit multiply operation. The globaladdress unit operation (2b) is a byte load. The "uh1" mnemonic indicatesthat this load operation extracts the second byte (byte 1) into a halfword (16 bits) of the destination with zero extension. The local addressunit operation is a data load. The current block data stored in memoryat the address stored in address register A0 is loaded into dataregister D6. The "w" mnemonic indicates that this is a word (32 bit)data transfer. The address register A1 is post incremented correspondingto the data size to point to the next 32 bit data word.

Instruction 3 includes a multiply operation forming the square. Thefirst data unit operation (3a) in a multiple unsigned "mu" 8 bit by 8bit multiply operation. The data is the absolute value of the differencestored in data register D4 and the result is stored in D4. The seconddata unit operation is an extended arithmetic logic unit true (EALUT)operation. Note that the multiple multiply operation is supported onlyin conjunction with an extended arithmetic logic unit operation. Thusthe desired set of function signals are pre-loaded in the "EALU" field(bits 26-19) of data register D0. This should occur during a set upportion of the program not shown above. The particular extendedarithmetic logic unit operation called for in instruction 4b is a rotateand add. The rotate is the default barrel rotate amount stored in the"DBR" field (bits 4-0) of data register D0, which is 16. Note that dataregister D3 is pre-loaded with the value Hex "00000000", thus addingzero during the rotate and add operation. This prepares the twodifferences in the most significant bits for multiple multiplication byrotating them to the 16 least significant bits. The global address unitoperation (3c) loads the first byte (byte 0) of data register D2 into ahalf word (16 bits) of index register X0 with zero extension. The localaddress unit operation (3d) performs an address unit arithmeticoperation using pre-addition of the index register to modify the baseaddress register. This adds a first squared error term LX₋₋ SqErr0stored in index register X0 to a running sum stored in address registerA0. The destination register D5 is a dummy and the desired data isstored in the modified address register A0.

The operations of instruction 4 are similar to those of instruction 3.Instruction 4 includes a multiple unsigned multiply operation (4a),which forms another set of squared error terms. Instruction 4 alsoincludes an extended arithmetic logic unit operation (4b), which is arotate and add operation the same as instruction 3b. In this case asecond squared error term Sq₋₋ ErrB stored in data register D4 isrotated 16 bits and added to the most significant bits of a running sumMSE₋₋ SumB stored in data register D1. The global address unit operationloads a word "w" of data from the address stored in address register A8into data register D5. This operation loads the preceding block datainto data register D5, which is subtracted during instruction 1a of thenext cycle through the loop kernel. The local address unit operation(4d) is an address unit arithmetic operation using pre-addition of theindex register to modify the base address register. This adds the secondsquared error term LX₋₋ SqErr1 stored in index register X1 to therunning sum stored in address register A0. Note that the destinationregister D5 is a dummy and the global address unit load operation abortsthis local address unit load operation. However, this is of noconsequence because the desired data is stored in the modified addressregister A0.

Instruction 5 includes only address unit operations. The global addressunit loads index register X0 with a zero extended half word from thefirst byte (byte 0) of data register D4. This operation loads a squarederror term formed during instruction 3a into the index register. Thelocal address unit performs an address arithmetic operation incrementinga running sum stored in address register A0 by a third squared errorterm. Note that the data stored in data register D5 is not used.

Instruction 6 includes only a global address unit operation. The globaladdress unit loads index register X1 with a zero extended half word fromthe second byte (byte 1) of data register D4. This operation loads theother squared error term formed during instruction 3a into the indexregister.

Instruction 7 includes only address unit operations. The global addressunit loads index register X0 with a zero extended half word from thefirst byte (byte 0) of data register D2. This operation loads a squarederror term formed during instruction 4a into the index register. Thelocal address unit performs an address arithmetic operation incrementinga running sum stored in address register A0 by a first squared errorterm.

This loop kernel assumes use of hardware loop logic 720 for control ofthe iterations necessary to form the summation. This may involve twonested loops as mathematically implied in the double summation or someform of unrolled loop that traverses the same terms. Note that this loopkernel also presupposes that the data terms are properly loaded inmemory accessible by local address unit 620, that is all the data isstored in the corresponding memories. Additional outer loop operationshandle the case where the number of elements in the summation is toolarge to be stored in the corresponding memories. Some wrap upoperations complete the mean squared error computation. The two runningsums stored in data register D1 and address register A0 are added toform the final summation. This summation is divided by the number ofelements to determine the final mean squared error. However, since thisloop kernel forms the most often executed portion of the program,efficiency at this point is most critical.

Median filtering is another technique widely used in image processing.Median filtering is a nonlinear signal processing technique useful inimage noise suppression. Each input pixel is replaced with the medianvalue pixel within a block surrounding the input pixel. It is known toemploy a 3 pixel by 3 pixel block surrounding the input pixel at thecenter. Median filtering does not effect step functions or rampfunctions in the image data. However, median filtering is very effectiveagainst discrete impulse noise, especially single pixel noise. Real timeimplementation of median filtering requires comparisons of each 3 by 3pixel block at the pixel input rate.

FIG. 48 illustrates a median filter algorithm suitable for use bymultiprocessor integrated circuit 100. This algorithm operatesseparately on each column of the 3 by 3 block of pixels having thecurrent pixel at the center. The comparisons for each column thendetermine the median value. In the example described in detail below,four 3 by 3 blocks of 8 bit pixels are processed simultaneously usingmultiple arithmetic logic unit operations. When moving to the nextadjacent 3 by 3 pixel block, the column comparisons for the twooverlapping columns are retained. The new comparison values for the newthird column are found, and then employed in determining the new median.This technique permits reduction in the determination of the columncomparisons. The algorithm advantageously employs conditional operationsto eliminate branches and their corresponding pipeline delay slots.

FIG. 48a illustrates the processing of each column of the 3 by 3 block.This processing makes comparison of the pixel values of each of thethree pixels in the column. FIG. 48a illustrates the comparisons forcolumn 0, but the comparisons for columns 1 and 2 are identical.Comparison 1051 determines the minimum and the maximum of Pixel₀₀ andPixel₀₁. The maximum of this comparison is passed to comparison 1051,which determined the minimum and the maximum of this maximum andPixel₀₂. The maximum of comparison 1052 is the maximum of the column,designated Max0. Comparison 1053 determines the minimum and maximum ofthe minimums of comparisons 1051 and 1052. The maximum of comparison1053 is the median of the column, designated Med0. The minimum ofcomparison 1053 is the minimum of the column designated Min0. As notedabove, this same set of comparisons is applied to the pixel values ofcolumn 1 yielding Max1, Med1 and Min1 and to the pixel values of column2 yielding Max2, Med2 and Min2.

FIG. 48b illustrates the processing of the respective column maximumvalues Max0, Max1 and Max2. Comparison 1060 determines the minimum ofMax0 and Max1. Note that the maximum of comparison 1060 is discarded.Comparison 1061 determines the minimum of the minimum result ofcomparison 1060 and Max2. The maximum of comparison 1061 is discardedand the minimum is designated MinMax. The value of MinMax is the minimumof the column maximum values.

FIG. 48c illustrates the processing of the respective column minimumvalues Min0, Min1 and Min2. Comparison 1062 determines the maximum ofMin0 and Min1. Note that the minimum of comparison 1062 is discarded.Comparison 1063 determines the maximum of the maximum result ofcomparison 1062 and Min2. The minimum of comparison 1063 is discardedand the maximum is designated MaxMin. The value of MaxMin is the maximumof the column minimum values.

FIG. 48d illustrates the processing of the respective column medianvalues Med0, Med1 and Med2. Comparison 1064 determines the minimum andmaximum of Med0 and Med1. Comparison 1065 determines the minimum of themaximum result of comparison 1064 and Med2. Note that the maximumdetermined by comparison 1065 is discarded. Comparison 1066 determinesthe maximum of the minimum of comparison 1064 and the minimum ofcomparison 1065. This value designated MedMed is the median of thecolumn median values. Note that the minimum value of comparison 1066 isdiscarded.

FIG. 48e illustrates the process of determining the block median fromMaxMin, MinMax and MedMed. Comparison 1067 finds the minimum and maximumof MaxMin and MinMax. Comparison 1068 determines the minimum of themaximum of comparison 1067 and MedMed. The maximum determined bycomparison 1068 is discarded. Comparison 1069 finds the maximum of theminimum of comparison 1068 and the minimum of comparison 1067. Thisvalue designated Median is the median value of the 3 by 3 block ofpixels. Note that the minimum determined by comparison 1069 isdiscarded.

Below are the instructions of a loop executing this median filteralgorithm. Note that instructions 1 to 9 generally perform the columncomparison processes illustrated in FIG. 48a for column 2 of the block,the last column. In this example it is assumed that two columncomparisons have already been made and are stored for use. This would bethe case if the algorithm were used repeatedly for an entire row of theimage data. For the first columns of each row, the steps of instructions1 to 9 must be repeated for column 0 and column 1. Instructions 10 to 13perform the column maximum comparison processes illustrated in FIG. 48b.Instructions 14 to 17 perform the column minimum comparison processesillustrated in FIG. 48c. Instructions 18 to 24 perform the column mediancomparison processes illustrated in FIG.

    ______________________________________                                        1a.           Dummy =mc Pack0 - Pack1                                           1b. ∥ *(G.sub.-- Col2SortAddr += [3]) = BlockMed                     2a.  TmpMax = @MF & Pack0 | ˜@MF & Pack1                       2b. ∥ Out1 =b *(G.sub.-- Col2SortAddr + 1)                           3a.  TmpMin = ˜@MF & Pack0 | @MF & Pack1                       3b. ∥ Out2 =b *(G.sub.-- Col2SortAddr + 2)                           3c. ∥ *(L.sub.-- OutAddr + LX.sub.-- Tile1Index) =b Out1                          4a.  Dummy =mc TmpMax - Pack2                                    4b. ∥ Out3 =b *(G.sub.-- Col2SortAddr + 3)                           4c. ∥ *(L.sub.-- OutAddr + LX.sub.-- Tile2Index) =b Out2                          5a.  Max2 = @MF & TmpMax | ˜@MF & Pack2                        5b. ∥ Out0 =b *G.sub.-- Col2SortAddr                    5c. ∥ *(L.sub.-- OutAddr + LX.sub.-- Tile3Index) =b Out3                          6a.  TmpMed = ˜@MF & TmpMax | @MF & Pack2                      6b. ∥ *(G.sub.-- Col2SortAddr -= [3]) = Max2                         6c. ∥ *L.sub.-- OutAddr ++= [b] Out0                    7a.  Dummy =mc TmpMin - TmpMed                                                7b. ∥ Max0 = *G.sub.-- Col0SortAddr                                  8a.  Med2 = @MF & TmpMin | ˜@MF & TmpMed                       8b. ∥ Max1 = *G.sub.-- Col1SortAddr                                  9a.  Min2 = ˜@MF & TmpMin| @MF & TmpMed                        9b. ∥ *(G.sub.-- Col2SortAddr + [1]) = Med2                          10a.  Dummy =mc Max0 - Max1                                                   10b. ∥ *(G.sub.-- Col2SortAddr + [2]) = Min2                         11a.  TmpMin = ˜@MF & Max0 | @MF & Max1                        11b. ∥ Max2 = *G.sub.-- Col2SortAddr                                 12a.  Dummy =mc Max2 - TmpMin                                                 12b. ∥ Min0 - *(G.sub.-- Col0SortAddr + [2])                         13a.  MinMax = ˜@MF & Max2 | @MF & TmpMin                      13b. ∥ Min1 = *(G.sub.-- Col1SortAddr + [2])                         14a.  Dummy =mc Min0 - Min1                                                   14b. ∥ *(G.sub.-- Col1SortAddr + [3]) = MinMax                       15a.  TmpMax = @MF & Min0 | ˜@MF & Min1                        15b. ∥ Min2 = *(G.sub.-- Col2SortAddr + [2])                         16a.  Dummy =mc Min2 - TmpMax                                                 16b. ∥ Med0 = *(G.sub.-- Col0SortAddr + [1])                         17a.  MaxMin = @MF & Min2 | ˜@MF & TmpMax                      17b. ∥ Med1 = *(G.sub.-- Col1SortAddr + [1])                         18a.  Dummy =mc Med0 - Med1                                                   18b. ∥ *(G.sub.-- Col0SortAddr + [3]) = MaxMin                       19a.  TmpMax = @MF & Med0 | ˜@MF & Med1                        19b. ∥ Med2 = *(G.sub.-- Col2SortAddr + [1])                         20a.  TmpMin = ˜@MF & Med0 | @MF & Med1                        20b. ∥ In0 =b *(G.sub.-- InputRow2Addr += 1)                         21a.  Dummy =mc Med2 - TmpMax                                                 21b. ∥ In1 =b *(G.sub.-- InputRow2Addr + GX.sub.-- Tile1Index)       21c. ∥ *L.sub.-- PackedRow2Addr ++=b In0                             22a.  TmpMedB = ˜@MF & Med2 | @MF & TmpMax                     22b. ∥ In2 =b *(G.sub.-- InputRow2Addr + GX.sub.-- Tile2Index)       22b. ∥ *L.sub.-- PackedRow2Addr ++=b In1                             23a.  Dummy =mc TmpMedB - TmpMin                                              23b. ∥ In3 =b *(G.sub.-- InputRow2Addr + GX.sub.-- Tile3Index)       23c. ∥ *L.sub.-- PackedRow2Addr ++=b In2                             24a.  MedMed = @MF & TmpMedB | ˜@MF & TmpMin                   24b. ∥ MinMax = *(G.sub.-- Col1SortAddr + [3])                       25a.  Dummy =mc MinMax - MedMed                                               25b. ∥ NewCol1SortAddr = G.sub.-- Col2SortAddr                       25c. ∥ *L.sub.-- PackedRow2Addr ++=b In3                             26a.  TmpMaxB = @MF & MinMax | ˜@MF & MedMed                   26b. ∥ MaxMin = *(G.sub.-- Col0SortAddr + [3])                       27a.  TmpMin = ˜@MF & MinMax | @MF & MedMed                    27b. ∥ NewCol2SortAddr = G.sub.-- Col0SortAddr                       28a.  Dummy =mc MaxMin - TmpMaxB                                              28b. ∥ G.sub.-- Col2SortAddr = NewCol2SortAddr                       29a.  TmpMedB = ˜@MF & MaxMin | @MF & TmpMaxB                  29b. ∥ NewCol0SortAddr = G.sub.-- Col1SortAddr                       29c. ∥ Pack2 = *(L PackedRow2Addr - [1])                             30a.  Dummy =mc TmpMin - TmpMedB                                              30b. ∥ G.sub.-- Col0SortAddr = NewCol0SortAddr                       30c. ∥ Pack1 = *L.sub.-- PackedRow1Addr ++                           31a.  BlockMed = @MF & TmpMin | ˜@MF & TmpMedB                 31b. ∥ G.sub.-- Col1SortAddr = NewCol1SortAddr                       31c. ∥ Pack0 = *L.sub.-- PackedRow0Addr ++                         ______________________________________                                    

Table 60 lists proposed data register assignments for implementing thisexample of a median filter algorithm.

                  TABLE 60                                                        ______________________________________                                        Data                                                                            Register Variable Name Data Assignment                                      ______________________________________                                        D1      Pack0            packed column 2                                          row 0 pixels                                                                 Max0 packed column 0                                                           maximum pixels                                                               Med0 packed column 0                                                           median pixels                                                                Min0 packed column 0                                                           minimum pixels                                                               NewCol1SortAddr temporary for address                                          pointer swap                                                                D2 Pack1 packed column 2                                                        row 1 pixels                                                                 Max1 packed column 1                                                           maximum pixels                                                               Med1 packed column 1                                                           median pixels                                                                Min1 packed column 1                                                           minimum pixels                                                               MedMed packed median of                                                        column medians                                                               NewCol2SortAddr temporary for address                                          pointer swap                                                                D3 Pack2 packed column 2                                                        row 2 pixels                                                                 Med2 packed column 2                                                           median pixels                                                                Min2 packed column 2                                                           minimum pixels                                                               MaxMin packed maximum of                                                       column minimums                                                             D4 MinMax packed minimum of                                                     column maximums                                                              TmpMax packed intermediate                                                     maximums                                                                     TmpMedB packed intermediate                                                    medians                                                                     D5 TmpMin packed intermediate                                                   minimums                                                                    D6 Max2 packed column 2                                                         maximum pixels                                                               TmpMaxB packed intermediate                                                    maximums                                                                     TmpMed packed intermediate                                                     medians                                                                      BlockMed final packed block                                                    medians                                                                      Out1 block B median pixel                                                     Out2 block C median pixel                                                     Out3 block D median pixel                                                     In0 input block A pixel                                                       In1 input block B pixel                                                       In2 input block C pixel                                                       In3 input block D pixel                                                       NewCol0SortAddr temporary for address                                          pointer swap                                                                D7 Dummy unused result                                                         Out0 block A median pixel                                                  ______________________________________                                    

As shown in Table 60, more than one variable is assigned to each dataregister. The complexity of the algorithm requires this reassignment ofthe data registers. Note that several of the variables are listed aspacked variables. This algorithm operates on 4 blocks of eight bitpixels simultaneously employing multiple arithmetic. A packed variableis divided into 4 sections as follows:

|block A pixel|block B pixel|block C pixel|block D pixel|

Packing the variables in this way speeds processing because four pixelsmay be handled during each arithmetic logic unit operation and fewermemory loads and stores are required.

Table 61 lists proposed address register assignments for implementingthis example of the median filter algorithm.

                  TABLE 61                                                        ______________________________________                                        Address                                                                         Register Variable Name Data Assignment                                      ______________________________________                                        A0      L.sub.-- PackedRow0Addr                                                                         packed row n input                                      pointer                                                                     A1 L.sub.-- PackedRow1Addr packed row n+1 input                                 pointer                                                                     A2 L.sub.-- PackedRow2Addr packed row n+2 input                                 pointer                                                                     A3 L.sub.-- OutAddr output pointer                                            A8 G.sub.-- Col2SortAddr pointer to sorted                                      column 2 data                                                               A9 G.sub.-- InputRow2Addr pointer to unpacked                                   row n+2                                                                     A10 G.sub.-- Col1SortAddr pointer to sorted                                     column 1 data                                                               A11 G.sub.-- Col0SortAddr pointer to sorted                                     column 0 data                                                             ______________________________________                                    

Table 62 lists proposed index register assignments for implementing thisexample of the median filter algorithm.

                  TABLE 62                                                        ______________________________________                                        Index                                                                           Register Variable Name Data Assignment                                      ______________________________________                                        X0       LX.sub.-- Tile1Index                                                                       pitch between blocks A and B                              X1 LX.sub.-- Tile2Index pitch between blocks A and C                          X2 LX.sub.-- Tile3Index pitch between blocks A and D                          X9 GX.sub.-- Tile1Index pitch between blocks A and B                          X10 GX.sub.-- Tile2Index pitch between blocks A and C                         X11 GX.sub.-- Tile3Index pitch between blocks A and D                       ______________________________________                                    

All the comparisons are made in a manner not requiring branches. Thissubstantially reduces the time to execute the algorithm due to theelimination of pipeline delay slots. These comparisons used conditionaloperations based upon the expanded state of multiple flags register 211.Such conditional operations permit selection of either the lesser or thegreater of two sets of packed values following a subtraction to setmultiple flags register 211.

Instructions 1 to 9 perform the column comparison processes illustratedin FIG. 48a. Instruction 1a forms the difference between two sets ofpacked pixels. These are the top and center rows of column 2 of the 3 by3 block. As noted, the actual value of the difference is unimportant forthis algorithm and so is designated Dummy. The "mc" mnemonic indicates amultiple operation that stores the respective carry bits in multipleflags register 211. This example operates on pixels of 8 bits, thusarithmetic logic unit 220 is divided into four sections of 8 bits each.This is accomplished by setting both the "Msize" field and the "Asize"field of status register 210 to "100". Thus each packed variable Pack0and Pack1 include a pixel from an A, a B, a C and a D block. Instruction1b is a store operation controlled by global address unit 610 thattemporarily stores packed block median data from the prior loop at theglobal column 2 sort address designated by G₋₋ Col2SortAddr asincremented by an offset value of 3 as scaled via index scaler 614 bythe data size. Since this is a word access the scaling is three bitpositions. The instruction format indicates that G₋₋ Col2SortAddr ispre-incremented and modified.

Instruction 2a merges the maximums of the packed column 0 and column 1pixels. If Pack0-Pack1>0 and thus Pack0>Pack1 for any of the blocks A,B, C or D, then instruction 1a generates a carry/borrow signal of "1".Multiple flags register 211 stores this "1". During instruction 2a this"1" is expanded in expander 238 to "11111111" (@MF). Thus the OR ofinstruction 2a returns the value from Pack0. Alternatively, ifPack0-Pack1<0 and thus Pack1<Pack1, then instruction 1a generates acarry/borrow signal of "0". Multiple flags register 211 stores this "0"until instruction 2a, when expander 238 expands it to "00000000" (˜@MF).Thus the OR of instruction 2a returns the value from Pack1. Thus TmpMaxstores the block wise maximums of rows 0 and 1 of column 2 of the blocksA, B, C and D. This completes determination of the maximum of comparison1051. Instruction 2b loads the median value of block A from the priorloop stored in one more than the global column 2 sort address into adata register employing global address unit 610. The "b" mnemonicindicates that this is a byte load operation.

Instruction 3a is the inverse of instruction 2a. Note that the @MF termin instruction 3a is of the opposite sense in the two halves of the ORstatement than that of instruction 2a. Instruction 3a uses thecarry/borrow data stored in multiple flags register 211 and expander 238to select the minimums of the packed column 2 pixel values of Pack0 andPack1. This completes determination of the minimum of comparison 1051.Instruction 3b is a global byte load operation of the block B medianpixel into a data register. Instruction 3c is a byte memory storeoperation. The data stored in data register D6 (Out1) is stored in thememory location having an address equal to the sum of the output pointerL₋₋ OutAddr and the n+1 packed row pointer LX₋₋ Tile1Index.

Instruction 4a is another subtraction setting carry/borrow bits ofmultiple flags register 211. In this case the difference is between thepacked temporary maximums and the packed row 2 data. This beginscomparison 1051. Instruction 4b is a global address unit byte load ofthe block D median pixel stored at address G₋₋ Col2SortAddr plus 2.Instruction 4c is a local address unit byte store of the block B medianpixel.

Instruction 5a is similar to instruction 2a. This instruction determinesand merges block wise the maximums of TmpMax and the row 3 data storedin Pack2 using the carry/borrow data stored in multiple flags register211. These merged maximums are stored in Max2. Instruction 5b is aglobal address unit byte load of the block A medial pixel. Instruction5c is a local address unit byte store of the block D median pixel.

Instruction 6a is similar to instruction 3a. This instruction determinesand forms a block wise merge of the minimums of TmpMax and the row 3data stored in Pack2 using the carry/borrow data still stored inmultiple flags register 211. These merged minimums are stored in TmpMin.Instruction 6b is a global address unit store of the Max2 data formed ininstruction 5a. This completes comparison 1052. The instruction mnemonicindicates that global address register G₋₋ Col2SortAddr ispre-decremented and modified by the offset value 3 as scaled to the datasize in index scaler 614. Instruction 6c is a local address unit storeof the median pixel value of block A at the local output pointer addressstored in L₋₋ OutAddr. This address register is pre-incremented by 1.

Instruction 7a forms a difference to set the carry/borrow signals inmultiple flags register 211. As in the case of instructions 1a and 4athe actual difference in discarded. This subtraction begins comparison1053. Instruction 7b loads the packed column 0 maximum pixels via globaladdress unit 610 from the global column 0 sort address.

Instruction 8a determines the maximum of comparison 1053. This result isthe column median Med2. Instruction 8b loads the packed column 1 maximumpixels via global address unit 610 from the global column 1 sortaddress.

Instruction 9a determines the minimum of comparison 1053. This result isthe column minimum Min2. Instruction 9b stores the packed column mediansMed2 into memory at the global column 2 sort address plus 1 scaled tothe data size.

Instructions 10 to 13 perform the column maximum comparison processesillustrated in FIG. 48b. This involves a comparison of the columnmaximum pixels for the three column, retaining only the minimum of thesecolumn maximums. Instruction 10a forms the difference of Max0 and Max1,setting multiple flags register 211 for the minimum determination ininstruction 11. This begins comparison 1060. Instruction 10b stores thepacked column 2 minimums to memory via global address unit 610.

Instruction 11a determines the block wise minimums of the column 0 andcolumn 1 maximums. As previously described, this determination is madefrom the expanded carry/borrow signals stored in multiple flags register211. This produces TmpMin and completes comparison 1060. Instruction 11bloads the packed column 2 maximums from memory via global address unit610.

The subtraction of instruction 12a begins comparison 1061. Thissubtraction sets multiple flags register 211 based upon the carry/borrowoutput. This begins comparison 1061. Instruction 12b loads the packedcolumn 0 minimums from memory via global address unit 610.

Instruction 13a completes comparison 1061. MinMax is set to the minimumof the respective column maximums for each block A, B, C and D.Instruction 13b loads the packed column 1 minimums from memory viaglobal address unit 610.

Instructions 14 to 17 perform the column minimum comparison processesillustrated in FIG. 48c. Instructions 14a and 15a form the maximums ofthe packed column 0 and column 1 minimums. This performs comparison1062. Instruction 16a and 17a perform comparison 1063 between themaximum of comparison 1062 and the column 2 minimums. Instruction 14astores the packed minimum of the column maximums MinMax formedinstruction 13a via global address unit. Instructions 15b, 16b and 17bload the column 2 minimums Min2, the column 0 medians and the column 1medians, respectively, via global address unit 610.

Instructions 18 to 24 perform the column median comparison processesillustrated in FIG. 48d. Instructions 18a, 19a and 20a performcomparison 1064. Instruction 19a determines the maximums of the column 0and column 1 medians. Instruction 20a determines the minimums of thecolumn 0 and column 1 medians. Instruction 18b stores the MinMax resultsof instruction 17a in memory via global address unit 610. Instruction19a loads the column 2 packed median data Med2. Instruction 20a employsglobal address unit 610 to load a byte of block A pixel data. Thisbegins a process of rearranging data to be in the desired packed columnformat for the next loop.

Instructions 21a and 22a perform comparison 1065. The result is TmpMedB,the packed column temporary median values. Instruction 21b loads thepixel data of block B via global address unit 610. Instruction 21cstores the byte of pixel data of block A via local address unit 620.Instruction 22b loads a byte of block C pixel data employing globaladdress unit 610. Instruction 22c employs local address unit 620 tostore the byte of block B pixel data.

Instructions 23a and 24a perform comparison 1066. The result is MedMed,the block wise packed median of the column medians. Instruction 23bperforms a block load of block D pixel employing global address unit610. Instruction 23c stores a byte of the block C pixel data using localaddress unit 620. Instruction 24b loads the packed minimums of columnmaximum MinMax employing global address unit 610.

Instructions 25 to 31 perform the formation of the median processesillustrated in FIG. 48e. Instructions 25a, 26a and 27a performcomparison 1067. Instruction 26a determines the maximums of MinMax andMedmed. Instruction 27a determines the minimums of MinMax and MedMed.Instruction 25b begins the process of realigning the address pointersfor the next loop by setting a temporary value NewCollSortAddr equal tothe prior column 2 global sort address G₋₋ Col2SortAddr. Instruction 25cstores a byte of pixel block D data using local address unit 620.Instruction 26b loads the maximum of the column minimums MaxMin viaglobal address unit 610. Instruction 27b continues realigning theaddress pointers for the next loop by setting a temporary valueNewCol2SortAddr equal to the prior column 0 global sort address G₋₋Col0SortAddr.

Instructions 28 and 29 perform comparison 1068. Instruction 28a is asubtraction setting multiple flags register 211. Instruction 29adetermines the minimums of MaXMin and the temporary maximum TmpMaxB frominstruction 26a. Instruction 28b continues the pointer rotation bysetting the global column 2 sort address equal to the new column 2 sortaddress set in instruction 27b. Instruction 29b continues the pointerrotation by setting a temporary value NewCol0SortAddr equal to theglobal column 1 sort address. Instruction 29c loads the packed column 2pixels using local address unit 620.

Instructions 30 and 31 perform comparison 1069 and determine the blockmedians BlockMed. Instruction 30a is the subtraction setting multipleflags register 211. Instruction 31a determines the maximum of comparison1069, which is the block medians BlockMed. Instruction 30b continues thepointer rotation by setting the global column 0 sort address equal tothe new column 0 sort address NewCol0SortAddr set in instruction 29b.Instruction 30c loads the packed column 1 pixels via local address unit6320. Instruction 31b completes the pointer rotation by setting theglobal column 1 sort address equal to the new column 1 sort addressNewCol1SortAddr set in instruction 25b. Instruction 31c loads the packedcolumn 0 pixels using local address unit 620.

Several other programming techniques are supported by the abovedescribed hardware of the digital image/graphics processors 71, 72, 73and 74. These include: employing the write priority of Table 51 toperform single instruction "if . . . then . . . else . . . " operations;mixed conditional operations; and zero overhead hardware branches withconditional test for zero.

An example of a single instruction "if . . . then . . . else . . . "operation is listed below. Note that a condition of status register 210must be set before the single instruction "if . . . then . . . else . .. " operation can be performed. In this example the condition is Data=0.

    ______________________________________                                        1.                  Data = Data                                                 2a.  Zero.sub.-- Run = Zero.sub.-- Run + 1                                    2b. ∥ Zero.sub.-- Run =[nz] A15                                    ______________________________________                                    

Table 63 shows an example of the register assignments for this programcode example.

                  TABLE 63                                                        ______________________________________                                        Register Variable Name  Data Assignment                                       ______________________________________                                        D6       Data           test data                                               D7 Zero.sub.-- Run number of consecutive                                        examples of Data = 0                                                      ______________________________________                                    

Instruction 1 doesn't change the contents of the data register D6. Thisinstruction does cause the status register 210 to set the negative "N",carry "C", overflow "V" and zero "Z" status bits based upon the resultof arithmetic logic unit 230. Though instruction 1 does not change thecontents of data register D6, this instruction may still set thenegative status "N" if D6<0 or the zero status "Z"if D6=0.

Instruction 2 performs the "if . . . then . . . else . . . " operation.If Data ≠0, then the condition of instruction 2b is true. Thus Hex "0"is moved from the zero value address register A15 to data register D7.Thus if Data ≠0, then the number of consecutive zeros is set to zero.Note that according to Table 51 this address unit operation has priorityover the data unit operation. Thus if the condition is true, theregister to register move operation occurs and the data unit operationaborts. Only if Data=0 does the data unit operation of instruction 2aincrement Zero₋₋ Run. Thus instruction 2 performs "if Data ≠0, thenZero₋₋ Run=0, else Zero₋₋ Run=Zero₋₋ Run+1."

Below is a second example of a single instruction "if . . . then . . .else . . . " operation. This example uses a compare for the conditionaloperation.

    ______________________________________                                        1a.                   Dummy = Data1 - Data2                                     1b. ∥ Dummy = Dummy                                                  2a.  Data1 = Data2                                                            2b. ∥ Data1 =[lt] A15                                              ______________________________________                                    

Table 64 shows an example of the register assignments for this programcode example.

                  TABLE 64                                                        ______________________________________                                        Register                                                                              Variable Name   Data Assignment                                       ______________________________________                                        D5      Data2           second data element                                     D6 Data1 first test element                                                   D7 Dummy dummy register not used                                            ______________________________________                                    

The subtraction of instruction la effectively compares the numbers Data1and Data2. If Data1<Data2, then the negative "N" status is set in statusregister 210. If Data1=Data2, then the zero "Z" status is set. Lastly,if Data1>Data2, then neither of these bits are set. This exampleillustrates another use of the write priority rules of Table 51. Theunconditional address unit register move of Dummy to Dummy, protectsDummy from change while permitting status register 210 to be set basedupon the arithmetic logic unit result. The register to register moveaborts storing the arithmetic logic unit result. If instruction la setsthe negative "N" status bit, the instruction 2b sets Data1 equal tozero. Otherwise instruction 2a sets Data1 equal to Data2. Thusinstruction 2 performs the operation "if Data1<Data2, then Data1=0, elseData1=Data2."

This same sequence can perform other "if . . . , then . . . , else . . ." operations. The sequence requires a first arithmetic logic unitoperation to set status register 210. A following instruction performsthe "if . . . , then . . . , else . . . " operation. This instructionincludes a conditional data unit register move or load operation basedupon at least one condition set in the first instruction. The "else"operation is a data unit operation having the same destination as theregister move or load operation.

It is possible to set conditions for conditional operations based uponplural tests. In a first example two tests are ANDed.

    ______________________________________                                        1.               Dummy = D1 - D2                                                2. Dummy =[z] D3 - D4                                                         3. BR =[z] IPRS                                                             ______________________________________                                    

Instruction 1 sets the zero "Z" status bit if D1=D2. Instruction 2 isconditional based upon the zero "Z" status bit. If the zero "Z" statusbit is "0", then instruction 2 is not performed and no status bits arechanged. If the zero "Z" status bit is "1", then instruction 2 isperformed, and the status bits are set based upon the difference of D3and D4. Instruction 3 is a conditional subroutine return. Note writingto BR changes only program counter PC 701 and does not changeinstruction pointer return from subroutine IPRS 704. Writing to programcounter PC 701 places the previous address stored in program counter PC701 into instruction pointer return from subroutine IPRS 704. Thissubroutine return is conditional on the zero "Z" status bit. Thus thesubroutine return occurs only if D1=D3 and D3=D4 is true. Note that thisconditional operation could also be based upon the negative "N" statusbit, the carry "C" status bit or the overflow "V" status bit. Thisconditional operation could also be based upon any of the compoundconditions listed in Table 41.

Instruction 3 above is only an example of a conditional instruction. Anydesired conditional instruction based upon the selected status bit orbits could be placed here. This could be an arithmetic logic unitoperation, a register load operation, a memory store operation of aregister to register move operation. Other program flow controloperations such as a branch or call are also possible. This conditionalinstruction may be an "if . . . , then . . . , else . . . " operationsuch as described above.

In a second example two tests are ORed. This is listed below.

    ______________________________________                                        1.              Dummy = D1 - D2                                                 2. Dummy =[nz] D3 - D4                                                        3. BR =[z] IPRS                                                             ______________________________________                                    

Instruction 1 sets the zero "Z" status bit if D1=D2. Instruction 2 isconditional based upon the inverse of the zero "Z" status bit (notzero). If the zero "Z" status bit is "1", that is D1=D2, theninstruction 2 is not performed and no status bits are changed. If thezero "Z" status bit is "0", then instruction 2 is performed, and thestatus bits are set based upon the difference of D3 and D4. Instruction3 is a conditional subroutine return. As stated above, instruction 3could be any conditional instruction based upon the zero "Z" status bit.If D1=D2, the zero "Z" status bit is "1" and instruction 2 abortedwithout changing any status bits. Thus instruction 3 executes. If D1≠D2,then instruction 2 executes and the zero "Z" status bit is set to "1" ifD3=D4. So instruction 3 executes if D1=D2 OR D3=D4. Note thatinstructions 2 and 3 could be based upon any single status bit or anycompound condition so long as they are logical inverses.

This technique may also be used for mixed conditions. An example of thisis listed below.

    ______________________________________                                        1.              Dummy = D1 - D2                                                 2. Dummy = [u.z] D3 - D4                                                      3. BR = [le] IPRS                                                           ______________________________________                                    

Instruction 1 sets the zero "Z" status bit if D1=D2. The "u.z" mnemonicof Instruction 2 indicates this instruction is unconditional and thatthe zero "Z" status bit is protected form change by this operation. Thusthe negative "N" status bit is set if D3<D4, but the zero "Z" status bitis not set if D3=D4. Instruction 3 is conditional based upon a "lessthan or equal" condition. As seen in Table 41, this condition is formedby (N&˜V) | (˜N&V) | Z. Thus the subroutine return is taken if D1=D2 andD3<D4. This is not the only mixed conditional operation feasible. Anycompound condition listed in Table 51 (positive p, lower than or samels, higher than hi, less than lt, less than or equal le, greater than orequal ge or greater than gt) can be used for instruction 3 of thisexample. Note as previously stated, any conditional instruction can besubstituted into instruction 3 for the conditional subroutine return ofthis example.

Conditional "hardware branching" using the zero overhead loop logic weredescribed above in conjunction with the description of the zero-overheadloop logic. Below is an example of a character search routine using asingle instruction with conditional hardware branching. This charactersearch routine makes four byte comparisons per loop using multiplearithmetic.

    ______________________________________                                        1.             Match = Hex "F0F0F0F0"                                           2. LE2 = Loop2.sub.-- End                                                     3. LRS2 = 0                                                                   4. LRSE1 = 511                                                                5. LS2 = Loop2.sub.-- Start                                                   6. Data = *(A0 = DBA)                                                          Loop1.sub.-- Start                                                            Loop1.sub.-- End:                                                             Loop2.sub.-- End:                                                             7a. Dummy = mz Data - Match                                                   7b. ∥ LS2 = MF                                                       7c. ∥ Data = *A0++                                                  8. . . .                                                                       Loop2.sub.-- Start:                                                          10.  A0 = A0 - 4                                                              11.  . . .                                                                  ______________________________________                                    

Instruction 1 loads the pattern to be matched into a register. In thiscase the pattern is one byte long and is repeated 4 times when stored.Instruction 2 sets the loop end address LE2 to the single instructionloop address. Instruction 3 writes the count "0" into both the loopcount register LC2 and the loop reload register LR2. Instruction 4 is asingle instruction loop fast initialization. Writing "511" to LRSE1writes the loop count 511 into both loop count register LC1 and loopreload register LR1, loads the value PC+3 into both the loop startregister LS1 and the Loop end register LE1, and sets the program flowcontrol unit loop control register LCTL to associate loop end registerLE1 with loop count register LC1. Instruction 5 the loop start registerLS2 with the branch address. Lastly, instruction 6 initializes addresspointer A0 and loads the first word to be searched from the memorylocation pointed to by address pointer A0.

Instruction 7 forms the single instruction loop. Instruction 7a formsthe difference between the data loaded in instruction 6 and thereference data Match. The "mz" mnemonic indicates that instruction 7a isa multiple instruction and that the zero status bits are stored inmultiple flags register 211. Note that the "Msize" field of dataregister D0 must have been set to the desired data size. This sets themultiple flags register 211 according to the multiple differences.Instruction 7b loads loop count register LC2 with the data stored inmultiple flags register 211. Note that multiple flags register 211 wasset by the difference Data-Match of the prior loop. Instruction 7cmodifies the address register A0 to point to the next data, and loadsthis data for the next loop. Instruction 8 starts the portion of theprogram that handles the case if no match is found before 512 loopsrecorded by loop count register LC1. Instruction 10 starts the portionof the program that handles the case when a match is found. Note thatthis instruction is at the address corresponding to Loop2₋₋ Start storedin loop start register LS2.

While none of the four bytes of Data and Match are identical, eachdifference is nonzero. Thus multiple flags register 211 stores all zerosfor the four sections. This status result is loaded into loop countregister LS2. With loop count register LS2 equal to zero, and loop countregister LC1 not equal to zero: loop count register LC1, the outer loop,is decremented; loop count register LC2 is reloaded with the value ofloop reload register LR2, which is zero; program counter 701 is loadedwith the address stored in loop start register LS1, which is the addressof the one instruction loop. Thus the instruction repeats.

The loop may end in two ways. First, loop count register LC1 maydecrement to zero. In this case the program continues with instruction8, the next following instruction. Second, the multiple difference maydetect at least one match. In this event multiple flags register 211 isnonzero because at least one of the multiple differences is zero. Whenthis nonzero result is loaded into loop count register LC2, the hardwareloop logic branches to the second loop start address, which is Loop2₋₋Start at instruction 10.

Instruction 10 subtracts 4 from address register A0. This resets addressregister A0 to the memory location having the match. As illustrated inFIG. 49, the program executes the single loop instruction 7 four timesbefore the branch is taken. In FIG. 49 instruction slot 1070 does notdetect a match, thus multiple flags register 211 stores "000". Theglobal address operation of instruction slot 1070 stores a nonzeroresult in loop count register LC2 from the previous iteration of theloop. In instruction slot 1071 a match is found and at least one of thebits of multiple flags register 211 is not zero. The global addressoperation of instruction slot 1071 stores the zero multiple flagsregister 211 contents from the arithmetic operation of instruction slot1070 in loop count register LC2. The global address operation ofinstruction slot 1072 stores the nonzero multiple flags register 211contents from the arithmetic operation of instruction slot 1071 in loopcount register LC2. There follows two delay slots, instruction slots1073 and 1074, which occur because the global address operation executesat the beginning of the execute pipeline stage and two instructions arein the pipeline before the branch can be taken. During each of theseinstructions the hardware loop logic continues to load the single loopinstruction due to the state of loop count register LC1. At instructionslot 1075 the branch is taken and the hardware loop logic branches toLoop2₋₋ Start. In instruction slot 1076 program counter 701 advancesnormally to the next memory address.

FIGS. 50, 51, 52 and 53 illustrate members of a family of hardwaredividers. FIG. 50 illustrates the hardware in a divider that forms twobits of the quotient per iteration. FIG. 51 illustrates in a schematicform the data flow through the apparatus of FIG. 50. FIG. 52 illustratesthe hardware in a divider that forms three bits of the quotient periteration. FIG. 53 illustrates in schematic form the data flow in adivider that forms three bits of the quotient per iteration. Each of themembers of this family of hardware dividers employs a conditionalsubtract and rotate algorithm. Each of the members of this familyemploys hardware parallelism to speed the division process.

FIG. 50 illustrates hardware divider 1100. Register 1101 stores theunsigned portion of the divisor, if the divisor is a signed number andsign latch 1102 stores the sign bit. If the divisor is unsigned, thenregister 1101 stores the entire divisor and sign latch 1102 stores a bitindicating a positive number. Register 1103 stores the unsigned portionof the numerator with sign latch 1104 storing the sign bit. If thenumerator is unsigned, register 1103 stores the entire numerator andsign latch 1104 stores a bit indicating a positive number. Controlsequencer 1130, which may be a state machine, controls loops of aniteration process with reference to a loop count stored in loop counter1131. Control sequencer 1130 controls data flow via multiplexers 1117,1118 and 1121 and forms two bits of the quotient each iteration. Thisquotient is stored in register 1105.

Hardware divider 1110 includes three full adders 1112, 1113 and 1114.These operate in parallel during the conditional subtract and rotateoperation. Those skilled in the art would realize that the numeratorwill generally have more bits than the denominator. The DIVI instructiondiscussed above provided for division of a 64 bit numerator by a 32 bitdivisor and division of a 32 bit numerator by a 16 bit divisor. Hardwaredivider 1100 is suitable for either case with suitable capacity ofregisters and the full adders. In the preferred embodiment the numeratorwill have two times the number of bits of the divisor. Full adders 1112,1113 and 1114 operate on the full width of data stored in register 1101and the most significant half of data stored in register 1103. Toprevent loss of data during carries (borrows), full adders 1112, 1113and 1114 should have one more bit than the number of bits of register1101.

Full adders 1112, 1113 and 1113 operate in parallel during eachiteration. Full adder 1112 subtracts the number stored in register 1101from the most significant bits of the number stored in register 1103,effectively subtracting the divisor from the most significant bits ofthe numerator/running remainder. Full adder 1113 subtract the numberstored in register 1101, left shifted one place by shift left circuit1141, from the most significant bits stored in register 1103. Thiseffectively subtracts two times the divisor from the most significantbits of the numerator/running remainder. Full adder 1114 has twoalternate operations. In an initial operation, control sequencer 1130controls multiplexer 1117 to select the output from shift left circuit1141 and multiplexer 1118 to select the output from register 1101. Thusfull adder 1114 adds the divisor to two times the divisor. The resultantof three times the divisor is stored in latch 1144. During normaloperation, control sequencer 1130 controls multiplexer 1117 to selectthe most significant bits of register 1103 and multiplexer 1118 toselect the output of latch 1144. Full adder 1114 then subtracts threetimes the divisor from the most significant bits of thenumerator/running remainder.

Control sequencer 1130 controls the loop operation of hardware divider1100. Negative detectors 1122, 1123 and 1124 determine if thesubtractions performed by the respective full adders 1112, 1113 and 1114result in a negative difference. Based upon these determinations,control sequencer 1130 generates two bits of the quotient, which arestored in register 1105, and controls multiplexer 1121. Multiplexer 1121selects either the original data in register 1103 or the resultant ofone of full adders 1112, 1113 or 1114 for storage in register 1103depending upon the results of the negative determinations. Followingeach such storage operation, control sequencer 1130 controls register1103 to shift left two places. Note that the storing the data selectedaccording the negative detectors 1122, 1123 and 1124 insures that nodata is lost in this shift operation. Control sequencer 1130 repeatsthis operation a number of times as set by the loop count in loopcounter 1131. The quotient from register 1105 may be negated by negatecircuit 1135 based upon the original sign bits stored in sign latches1102 and 1103. If needed, the remainder is stored in register 1103 andmay be negated by negate circuit 1136 depending upon the original signbits stored in sign latches 1102 and 1103.

FIG. 51 illustrates in schematic form the data flow during operation ofhardware divider 1100. Initially the apparatus simultaneously forms thequantities D, 2D and 3D, where D is the divisor stored in register 1101.These quantities may be formed using simultaneous addition blocks 1141,1143 and 1143, respectively, employing the three full adders 1112, 1113and 1114 as shown in FIG. 51 with the results stored in correspondinglatches. Addition block 1141 adds "0" and D to get D. Addition block1142 adds "0" and D left shifted one place to get 2D. Addition block1143 adds D and D left shifted one place to get 3D. Alternatively, only3D need be formed by an adder (block 1143) and stored as illustrated inFIG. 50 because the quantities D and 2D can easily be formed in realtime during each iteration.

Next, hardware divider 1100 simultaneously forms the differencesN(hi)-D, N(hi)-2D and N(hi)-3D using the three full adders 1112, 1113and 1114 in blocks 1151, 1152 and 1153, where N(hi) is the mostsignificant bits of the numerator/running remainder stored in register1103. The results of these three trial subtractions determine the twobit partial quotient and the data to be recirculated as thenumerator/running remainder. Simultaneous negative test blocks 1154,1155 and 1156 determine if the quantities N(hi)-D, N(hi)-2D and N(hi)-3Dare negative. There are four possible results of these simultaneousnegative tests. If N(hi)-D<0, then the two quotient bits V are "00" andN(hi) is recirculated (block 1161). If N(hi)-D>0 and N(hi)-2D<0, andthen the two quotient bits V are "01" and N(hi)-D is recirculated(1162). If N(hi)-2D>0 and N(hi)-3D<0, then the two quotient bits V are"10" and N(hi)-2D is recirculated (1163). Lastly, if N(hi)-3D>0, thenthe two quotient bits V are "11" and N(hi)-3D is recirculated (block1164). These results represent the four possible outcomes for the trialsubtractions and the corresponding quotient and recirculationquantities.

The data within register 1103 is then left shifted by two places (block1170). As previously described, the selection of the recirculated databased upon the trial subtraction insures that no data is lost in thisshift operation. Block 1170 also forms an OR of the shiftednumerator/running remainder and V. Since the two least significant bitplaces have just been cleared by the left shift, this OR operationplaces the just calculated quotient bits into the least significant bitsof register 1103. Since the numerator has the same number of bits as thesum of the bits of the remainder and the quotient, this process permitsthe same register to hold initially hold the numerator, the runningremainder and to hold the final remainder and quotient at the end of theprocess. Note that this same result can be achieved by shifting in thetwo bits of V during the left shift operation. This is similar to themanner of shifting data register 200a and multiple flags register 211 asillustrated in FIG. 44, except that two bits are shifted in rather thanonly one. The loop count is incremented in block 1171. If the loop countis not greater than 8 (block 1172), then another iteration begins withsimultaneous subtractions blocks 1151, 1152 and 1153. Note that the loopcount of 8 is appropriate for a division of a 32 bit numerator by a 16bit divisor yielding a 16 bit quotient. For the division of a 64 bitnumerator by a 32 bit divisor yielding a 32 bit quotient a loop count of16 is selected.

Two clean up operations occur following completion of the selectednumber of iterations. Block 1173 determines the sign of the quotientfrom an exclusive OR of the sign of the numerator and divisor. If thesign of the quotient is negative, then block 1174 forms the inverse ofthe computed quotient. In parallel is a determination of the sign of theremainder. Block 1175 determines if the numerator was less than zero. Ifthe numerator was less than zero, then block 1176 forms the inverse ofthe computed remainder that is stored in register 1103. In any case thedivision operation is complete and ended at exit block 1177.

A hardware divider such as illustrated in FIG. 50 may be as useful asmultiplier 220 illustrated in FIG. 5. In the preferred embodiment adivision operation employs similar data paths and instruction wordformats as those used for multiplication. It is feasible to employ someof the adders used in the common Booth adder type multiplier circuit toembody full adders 1112, 1113 and 1114. Thus the hardware divider wouldrequire few additional components.

FIG. 52 illustrates the major components of hardware divider 1100a thatforms three bits of the quotient per iteration. Hardware divider 1100aincludes register 1101, sign latch 1102, register 1103, sign latch 1104,control sequencer 1130 and loop counter 1131, which are similar to thecorresponding parts illustrated in FIG. 50. Hardware divider 1110aincludes seven full adders 1112, 1113, 1114, 1115, 1116, 1117 and 1118.These operate in parallel during the conditional subtract and shiftoperation. During the initial step, multiplexer 1154 supplies thedivisor from register 1101 and the divisor from register 1101 leftshifted via shift left circuit 1141 to full adder 1114. Full adder 1114thus forms three times the divisor, which is stored in latch 1144.During the initial step, multiplexer 1156 supplies the divisor fromregister 1101 and the divisor from register 1101 left shifted two placesvia shift left circuits 1141 and 1142 to full adder 1116, thus formingfive times the divisor, which is stored in latch 1146. During theinitial step, multiplexer 1157 supplies the divisor from register 1101left shifted via shift left circuit 1141 and the divisor from register1101 left shifted two places via shift left circuits 1141 and 1142 tofull adder 1117. This forms six times the divisor, which is stored inlatch 1147. Also during the initial step, multiplexer 1158 supplies thedivisor from register 1101 and the divisor from register 1101 leftshifted three places via shift left circuits 1141, 1142 and 1143 to fulladder 1118. Full adder 1118 then subtracts the divisor from eight timesthe divisor, forming seven times the divisor, which is stored in latch1148. During each iteration, full adders 1112, 1113, 1114, 1115, 1116,1117 and 1118 subtract respectively one times, two times, three times,four times, five times, six times and seven times the divisor stored inregister 1101 from the most significant bits of register 1102. Note thatduring each iteration multiplexers 1154, 1156, 1157 and 1158 select thenumerator and the multiple of the divisor.

Control sequencer 1130 controls the loop operation of hardware divider1100. Negative detectors 1122, 1123, 1124, 1125, 1126, 1127 and 1128determine if the subtractions performed by the respective full adders1112, 1113, 1114, 1115, 1116, 1117 and 1118 result in a negativedifference. Based upon these determinations, control sequencer 1130generates three bits of the quotient. These three bits of the quotientare stored in the least significant bits of register 1103. Note thatregister 1103 is shifted three bits each iteration, making room for thequotient bits. In other respects control sequencer 1130 of FIG. 52operates like that previously described with regard to FIG. 50. Thequotient from the least significant bits of register 1103 may be negatedby negate circuit 1135 based upon the original sign bits stored in signlatches 1102 and 1103. If needed, the remainder stored in the mostsignificant bits of register 1103 may be negated by negate circuit 1136depending upon the original sign bits stored in sign latches 1102 and1103.

FIG. 53 illustrates schematically data flow within hardware divider1100a illustrated in FIG. 52. The divisor is stored in register 1101,the numerator in register 1103 and the loop count limit in register1131. Initially the process uses seven full adders to compute sevenmultiples of the divisor. This is accomplished by simultaneous additionblocks 1201, 1202, 1203, 1203, 1204, 1205, 1206 and 1207. Addition block1201 forms 0+D=D; addition block 1202 forms 0+D<<1=2D; addition block1203 forms D+D<<1=3D; addition block 1204 forms 0+D<<2=4D; additionblock 1205 forms D+D<<2=5D; addition block 1206 forms D<<1+D<<2=6D;addition block 1207 forms D<<3-D=7D; where <<n is left shifting nplaces. Thus simultaneous addition blocks 1201, 1202, 1203, 1203, 1204,1205, 1206 and 1207 form each multiple of D from 1 to 7. At least 3D,5D, 6D and 7D are stored in latches for use each iteration. Note that D,2D and 4D need not be stored in latches because these quantities can beeasily formed from D stored in register 1101.

Next the respective multiples of D are subtracted from the mostsignificant bits of the numerator/running remainder stored in register1103. Simultaneous subtractions 1211, 1212, 1213, 1214, 1215, 1216 and1217 form the differences between N(hi) and D, 2D, 3D, 4D, 5D, 6D and7D, respectively. As in simultaneously addition blocks 1201, 1202, 1203,1203, 1204, 1205, 1206 and 1207 above, these simultaneous subtractionsare formed using seven full adders. The results of these seven trialsubtractions determine the three bit partial quotient and the data to berecirculated as the numerator/running remainder. Simultaneous negativetest blocks 1221, 1222, 1223, 1224, 1225, 1226 and 1227 determine if thequantities N(hi)-D, N(hi)-2D, N(hi)-3D, N(hi)-4D, N(hi)-5D, N(hi)-6D andN(hi)-7D are negative. There are eight possible results of thesesimultaneous negative tests. If N(hi)-D<0, then V="000" and N(hi) isrecirculated (block 1231). If N(hi)-D>0 and N(hi)-2D<0, and then V="001"and N(hi)-D is recirculated (block 1232). If N(hi)-2D>0 and N(hi)-3D<0,then V="010" and N(hi)-2D is recirculated (block 1233). If N(hi)-3D>0and N(hi)-4D<0, then V="011" and N(hi)-3D is recirculated (block 1234).If N(hi)-4D>0 and N(hi)-5D<0, then V="100" and N(hi)-4D is recirculated(block 1235). If N(hi)-5D>0 and N(hi)-6D<0, then V="101" and N(hi)-5D isrecirculated (block 1236). If N(hi)-6D>0 and N(hi)-7D<0, then V="110"and N(hi)-6D is recirculated (block 1237). If N(hi)-7D>0, then V="111"and N(hi)-7D is recirculated (block 1238).

The data within register 1103 is then left shifted by three places(block 1241). Block 1241 also forms an OR of the shiftednumerator/running remainder and V. This OR operation places the justcalculated three quotient bits into the least significant bits ofregister 1103. Similarly to that discussed above in conjunction withblock 1170 of FIG. 51, this same result can be achieved by shifting inthe three bits of V during the left shift operation.

The loop count is decremented in block 1242. If the loop count has notreached zero (block 1243), then another iteration begins withsimultaneous subtractions blocks 1211, 1212, 1213, 1214, 1215, 1216 and1217. Note that FIG. 52 illustrates decrementing the loop count from aset loop limit to zero rather than incrementing the loop count from 1 toa limit. Either of these techniques may be employed in hardware dividersof this type. If iterations are complete, then block 1244 representing aclean-up operation occurs. This process has been previously described inconjunction with blocks 1173, 1174, 1175 and 1176 of FIG. 51. Thedivision operation is complete and ended at exit block 1245.

As previously mentioned, FIGS. 50, 51, 52 and 53 illustrate members of afamily of hardware dividers. Each member of this family of hardwaredividers employs 2^(N) -1 parallel full adders to form every trialsubtraction from 1 to 2^(N) -1 times the divisor. N bits of the quotientand a running remainder are determined from the results of these trialsubtractions. The quotient may be formed in a separate register.Alternatively, the quotient may be shifted into the emptied bits of thenumerator/running remainder register. This takes advantage of therelationship between the number of bits of the numerator, finalremainder and quotient. Table 65 illustrates the properties of membersof this family of hardware divider. Note that the DIVI instructiondescribed above falls into the first member of this family, hardwaredivider 1100 illustrated in FIG. 50 the second member of this family andhardware divider 1100a illustrated in FIG. 52 the third member of thisfamily.

                  TABLE 65                                                        ______________________________________                                        Quotient Number of         Number of                                            bits per parallel iterations for                                            iteration                                                                              adders            32/16  64/32                                       ______________________________________                                        1         1                16     32                                            2  3 8 16                                                                     3  7 6 11                                                                     4 15 4 8                                                                      5 31 4 7                                                                      6 63 3 6                                                                      7 127  3 5                                                                    8 255  2 4                                                                    16  65535   1 2                                                               32  4294967295     1 1                                                      ______________________________________                                    

Table 65 illustrates a startling diminishing return to scale. If thenumber of bits per iteration is N, the then number of parallel fulladders needed is 2^(N) -1. The greatest number of bits per iteration forpractical devices in current semiconductor technology is probably 3 or4. Current Booth re-coding multiply circuits may have 9 full adders.Thus 15 full adders for division is not unreasonable, particularly ifthe adders can be used for both hardware multiply and hardware divide.Use of additional hardware for divides of more than 4 bits per iterationis not currently economically feasible.

FIG. 54 illustrates an alternative embodiment of this invention. In FIG.54 multiprocessor integrated circuit 101 includes master processor 60and a single digital image/graphics processor 71. Multiprocessorintegrated circuit 101 requires less silicon substrate area thanmultiprocessor integrated circuit 100 and consequently can beconstructed less expensively. Multiprocessor integrated circuit 101 isconstructed using the same techniques as previously noted forconstruction of multiprocessor integrated circuit 100. Because the widthof each digital image/graphics processor matches the width of itscorresponding memory and the associated portions of crossbar 50,multiprocessor integrated circuit 100 may be cut between digitalimage/graphics processors 71 and 72 to obtain the design ofmultiprocessor integrated circuit 101. Multiprocessor integrated circuit101 can be employed for applications when the processing capacity offour digital image/graphics processors is not required.

Multiprocessor integrated circuit 101 is illustrated in FIG. 54 as partof a color facsimile apparatus. Modem 1301 is bidirectionally coupled toa telephone line for sending and receiving. Modem 1301 also communicateswith buffer 1302, which is further coupled the image system bus. Modem1301 receives a fascimile signal via the telephone line. Modem 1301demodulates these signals, which are then temporarily stored in buffer1302. Transfer controller 80 services buffer 1302 by transferring datato data memories 22, 23 and 24 for processing by digital image/graphicsprocessor 71. In the event that digital image/graphics processor 71cannot keep ahead of the incoming data, transfer controller 80 may alsotransfer data from buffer 1302 to memory 9. Digital image/graphicsprocessor 71 processes the image data of the incoming facsimile. Thismay include image decompression, noise reduction, error correction,color base correction and the like. Once processed, transfer controller80 transfers image data from data memories 22, 23 and 24 to video randomaccess memory (VRAM) 1303. Printer controller 1304 recalls the imagedata under control of frame controller 90 and supplies it to colorprinter 1305, which forms the hard copy.

The apparatus of FIG. 54 can also send a color facsimile. Imaging device3 scans the source document. Imaging device 3 supplies the raw imagedata to image capture controller 4 that operates under control of framecontroller 90. This image data is stored in video random access memory1303. Note that the embodiment illustrated in FIG. 54 shares videorandom access memory 1303 for both image capture and image display incontrast to the embodiment of FIG. 1, which uses separate video randomaccess memories. Transfer controller 80 transfers this image data todata memories 22, 23 and 24. Digital image/graphics processor 71 thenprocesses the image data for image compression, error correctionredundancy, color base correction and the like. The processed data istransferred to buffer 1303 by transfer controller 80 as needed tosupport the facsimile transmission. Depending upon the relative datarates, transfer controller 80 may temporarily store data in memory 9before transfer to buffer 1302. This image data in buffer 1302 ismodulated by modem 1301 and transmitted via the telephone line.

Note that the presence of an imaging device and a color printer in thesame system permits this system to also operate as a color copier. Inthis event data compression and decompression may not be required.However, digital image/graphics processor 71 is still useful for noisereduction and color base correction. It is also feasible for digitalimage/graphics processor 71 to be programmed to deliberately shiftcolors so that the copy has different coloring than the original. Thistechnique, known as false coloring, is useful to conform the dynamicrange of the data to the dynamic range of the available print colors.

We claim:
 1. A method for forming a sum of data in 2^(N) equal sectionsof a single data word comprising the steps of for each M from 1 toN:forming an Mth mask having bits of a first digital state filling M oddalternate sections and bits of a second digital state filling M evenalternate sections, said second digital state being opposite to saidfirst digital state; masking a prior sum data word by a first maskthereby forming a prior sum masked data word, the prior sum data wordfor M=1 being the single data word; rotating the prior sum data word byM sections; masking the rotated prior sum data word by the Mth maskthereby forming a rotated prior sum masked data word; summing the priorsum masked data word and the rotated prior sum masked data word therebyforming a sum data word, a last sum data word being the sum of data in2^(N) equal sections of the single data word.
 2. The method of claim 1,wherein:said step of masking the prior sum data word consists of forminga logical AND of the Mth mask and the prior sum data word; and said stepof masking the rotated prior sum data word consists of forming thelogical AND of the Mth mask and the rotated prior sum data word.
 3. Themethod of claim 1, wherein:said step of rotating the prior sum data wordoccurs in a barrel rotator, said barrel rotator having a data input, arotate control input receiving a rotate control signal, and a dataoutput; said steps of masking the prior sum data word, masking therotated prior sum data word and summing the prior sum masked data wordand the rotated prior sum masked data word occur substantiallysimultaneously for each M in a three input arithmetic logic unit, saidthree input arithmetic logic unit having a first input receiving theprior sum data word, a second input receiving the rotated prior sum dataword, a third input receiving the Mth mask and an output generating thesummed prior sum masked data word and rotated prior sum masked dataword.
 4. The method of claim 1, wherein:each of said Mth masks has saidfirst digital state equal to "1" and said second digital state equal to"0".
 5. A method for forming a sum of data in plural equal sections of asingle data word comprising the steps of repeatedly:forming a maskhaving bits of a first digital state filling odd alternate portions andbits of a second digital state filling even alternate portions, saidsecond digital state being opposite to said first digital state, saidportion initially having a size equal to a section; masking a prior sumdata word by the mask thereby forming a masked prior sum data word, thesingle data word being a first prior sum data word; rotating the priorsum data word by one portion; masking the rotated prior sum data word bythe mask thereby forming a masked rotated prior sum data word; summingthe masked prior sum data word and the masked rotated prior sum dataword, thereby forming a sum data word; doubling said size of each ofsaid portions for a next repetition, until all sections are summed. 6.The method of claim 5, wherein:said step of masking the prior sum dataword consists of forming the logical AND of the mask and the prior sumdata word; and said step of masking the rotated prior sum data wordconsists of forming the logical AND of the mask and the rotated priorsum data word.
 7. The method of claim 5, wherein:said step of rotatingthe prior sum data word occurs in a barrel rotator, said barrel rotatorhaving a data input, a rotate control input receiving a rotate controlsignal, and a data output; said steps of masking the prior sum dataword, masking the rotated prior sum data word and summing the prior summasked data word and the rotated prior sum masked data word occursubstantially simultaneously for each repetition in a three inputarithmetic logic unit, said three input arithmetic logic unit having afirst input receiving the prior sum data word, a second input receivingthe rotated prior sum data word, a third input receiving the mask and anoutput generating the sum of the prior sum masked data word and therotated prior sum masked data word.
 8. The method of claim 5,wherein:each of said masks has said first digital state equal to "1" andsaid second digital state equal to "0".
 9. A method for forming a sum ofdata in four equal sections of a single data word comprising the stepsof:forming a first mask having "1's" filling a first and a third sectionand "0's" filling a second and a fourth section; masking the single dataword by the first mask thereby forming a first masked data word;rotating the single data word by one section; masking the rotated singledata word by the first mask thereby forming a second masked data word;summing the first masked data word and the second masked data wordthereby forming a first sum data word; forming a second mask having"1's" filling the first and second sections and "0's" filling the thirdand fourth sections; masking the first sum data word by the second maskthereby forming a third masked data word; rotating the first sum dataword by two sections; masking the rotated first sum data word by thesecond mask thereby forming a fourth masked data word; summing the thirdmasked data word and the fourth masked data word thereby forming aresultant data word.
 10. The method of claim 9, wherein:each of saidsteps of rotating the single data word and rotating the first sum dataword occurs in a barrel rotator, said barrel rotator having a datainput, a rotate control input receiving a rotate control signal, and adata output; each of a set of said steps of masking the single dataword, masking the rotated single data word and summing the first maskeddata word and the second masked data word and a set of said steps ofmasking the first sum data word, masking the rotated first sum data wordand summing the third masked data word and the fourth masked data wordoccur substantially simultaneously in a three input arithmetic logicunit, said three input arithmetic logic unit having a first inputreceiving a selected one of the single data word or the first sum dataword, a second input receiving a corresponding selected one of therotated single data word or the rotated first sum data word, a thirdinput receiving a corresponding selected one of the first mask or thesecond mask, and an output generating the sum.
 11. A data processingapparatus forming a sum of data in plural equal sections of a singledata word comprising:a plurality of data registers, said single dataword stored in a first data register; a three input arithmetic logicunit having first, second and third signal inputs, a function input andan output; a barrel rotator having a data input, a rotate control inputreceiving a rotate control signal, and a data output connected to saidsecond signal input of the arithmetic logic unit, said barrel rotatorleft rotating data supplied to said data input an amount correspondingto said rotate control signal and supplying left rotated data to saidsecond signal input of said arithmetic logic unit; an instructiondecoder responsive to a stream of instructions and connected to saidplurality of data registers, said arithmetic logic unit and said barrelrotator, said instruction decoder responsive to a first instructiontosupply said single data word stored in said first data register tosaid first signal input of said arithmetic logic unit and to said datainput of said barrel rotator, supply a corresponding mask to said thirdsignal input of said arithmetic logic unit, supply a rotate amount tosaid rotate control input of said barrel rotator, control saidarithmetic logic unit to perform addition of data received at said firstand second signal inputs as masked by said corresponding mask receivedat said third signal input, and store an output of said arithmetic logicunit in said first data register; whereby repeated receipt of said firstinstruction together with corresponding masks and rotate amounts sumslarger and larger number of sections of the single data word.
 12. Thedata processing apparatus of claim 11, wherein:said mask having "1's"filling odd alternate M sections and "0's" filling even alternate Msections, where M is the number of repetitions of said firstinstruction; and said rotate amount is equal to 2^(M) sections.
 13. Adata processing apparatus forming a sum of data in four equal sectionsof a single data word comprising:a plurality of data registers, saidsingle data word stored in a first data register; a three inputarithmetic logic unit having first, second and third signal inputs, afunction input and an output; a barrel rotator having a data input, arotate control input receiving a rotate control signal, and a dataoutput connected to said second signal input of the arithmetic logicunit, said barrel rotator left rotating data supplied to said data inputan amount corresponding to said rotate control signal and supplying leftrotated data to said second signal input of said arithmetic logic unit;an instruction decoder responsive to a stream of instructions andconnected to said plurality of data registers, said arithmetic logicunit and said barrel rotator, said instruction decoder responsive to afirst instruction tosupply said single data word stored in said firstdata register to said first signal input of said arithmetic logic unitand to said data input of said barrel rotator, supply a first maskhaving "1's" filling a first and a third section and "0's" filling asecond and a fourth section to said third signal input of saidarithmetic logic unit, supply a first rotate amount corresponding to onesection of said single data word to said rotate control input of saidbarrel rotator, control said arithmetic logic unit to perform additionof data received at said first and second signal inputs as masked bysaid first mask received at said third signal input, and store an outputof said arithmetic logic unit in said first data register, saidinstruction decoder responsive to a second instruction tosupply data insaid first data register to said first signal input of said arithmeticlogic unit and to said data input of said barrel rotator, supply asecond mask having "1's" filling said first and second sections and"0's" filling said third and fourth sections to said third signal inputof said arithmetic logic unit, supply a rotate amount corresponding totwo sections of said single data word to said rotate control input ofsaid barrel rotator, control said arithmetic logic unit to performaddition of data received at said first and second signal inputs asmasked by said second mask received at said third signal input, andstore said output of said arithmetic logic unit in said first dataregister.
 14. The data processing apparatus claimed in claim 13,wherein:said first mask is stored in a second data register; and saidinstruction decoder supplies data from said second data register to saidthird signal input of said arithmetic logic unit in response to saidfirst instruction.
 15. The data processing apparatus claimed in claim13, wherein:said first rotate amount is stored in a predetermined datafield in a third data register; and said instruction decoder suppliesdata from said predetermined data field of said third data register tosaid rotate control input of said barrel rotator in response to saidfirst instruction.
 16. The data processing apparatus claimed in claim13, wherein:said second instruction includes an immediate data field;said data processing apparatus further comprises a mask generator havinga mask control input receiving a mask control signal and an outputconnected to said third signal input of said arithmetic logic unit, saidmask generator supplying to said third signal input of said arithmeticlogic unit a mask having a number of right justified "1's" correspondingto said mask control signal; and said instruction decoder supplies datafrom said immediate data field of said third data register to saidrotate control input of said barrel rotator and to said mask controlinput of said mask generator in response to said second instruction. 17.An data processing system forming a sum of data in four equal sectionsof a single data word comprising:an data system bus transferring dataand addresses; a system memory connected to said data system bus, saidsystem memory storing data and transferring data via said data systembus; an data processor circuit connected to said data system bus, saiddata processor circuit including a plurality of data registers, a singledata word stored in a first data register; a three input arithmeticlogic unit having first, second and third signal inputs, a functioninput and an output; a barrel rotator having a data input, a rotatecontrol input receiving a rotate control signal, and a data outputconnected to said second signal input of the arithmetic logic unit, saidbarrel rotator left rotating data supplied to said data input an amountcorresponding to said rotate control signal and supplying left rotateddata to said second signal input of said arithmetic logic unit; aninstruction decoder responsive to a stream of instructions and connectedto said plurality of data registers, said arithmetic logic unit and saidbarrel rotator, said instruction decoder responsive to a firstinstruction tosupply said single data word stored in said first dataregister to said first signal input of said arithmetic logic unit and tosaid data input of said barrel rotator, supply a first mask having "1's"filling a first and a third section and "0's" filling a second and afourth section to said third signal input of said arithmetic logic unit,supply a first rotate amount corresponding to one section of said singledata word to said rotate control input of said barrel rotator, controlsaid arithmetic logic unit to perform addition of data received at saidfirst and second signal inputs as masked by said first mask received atsaid third signal input, and store an output of said arithmetic logicunit in said first data register, said instruction decoder responsive toa second instruction tosupply data in said first data register to saidfirst signal input of said arithmetic logic unit and to said data inputof said barrel rotator, supply a second mask having "1's" filling saidfirst and second sections and "0's" filling said third and fourthsections to said third signal input of said arithmetic logic unit,supply a second rotate amount corresponding to two sections of saidsingle data word to said rotate control input of said barrel rotator,control said arithmetic logic unit to perform addition of data receivedat said first and second signal inputs as masked by said second maskreceived at said third signal input, and store said output of saidarithmetic logic unit in said first data register.
 18. The dataprocessing system claimed in claim 17, wherein:said first mask is storedin a second data register; and said instruction decoder supplies datafrom said second data register to said third signal input of saidarithmetic logic unit in response to said first instruction.
 19. Thedata processing system claimed in claim 17, wherein:said first rotateamount is stored in a predetermined data field in a third data register;and said instruction decoder supplies data from said predetermined datafield of said third data register to said rotate control input of saidbarrel rotator in response to said first instruction.
 20. The dataprocessing system claimed in claim 17, wherein:said second instructionincludes an immediate data field; said data processing apparatus furthercomprises a mask generator having a mask control input receiving a maskcontrol signal and an output connected to said third signal input ofsaid arithmetic logic unit, said mask generator supplying to said thirdsignal input of said arithmetic logic unit a mask having a number ofright justified "1's" corresponding to said mask control signal; andsaid instruction decoder supplies data from said immediate data field ofsaid third data register to said rotate control input of said barrelrotator and to said mask control input of said mask generator inresponse to said second instruction.
 21. The data processing system ofclaim 17, wherein:said data processor circuit further includesaplurality of data memories connected to said data processor circuit, aninstruction memory supplying instructions to said data processorcircuit, and a transfer controller connected to said data system bus,each of said data memories and said instruction memory controlling datatransfer between said system memory and said plurality of data memoriesand between said system memory and said instruction memory.
 22. The dataprocessing system of claim 21, wherein:said data processor circuitfurther includesat least one additional data processor circuit identicalto said data processor circuit, a plurality of additional data memoriesconnected to each additional data processor circuit, an additionalinstruction memory supplying instructions to each additional dataprocessor circuit, and said transfer controller is further connected toeach of said additional data memories and each said additionalinstruction memory controlling data transfer between said system memoryand said each of said additional data memories and between said systemmemory and each said additional instruction memory.
 23. The dataprocessing system of claim 22, wherein:said data processor circuitincluding said data processor circuit, said data memories, saidinstruction memories, each of said additional data processor circuits,each of said additional data memories, each additional instructionmemory and said transfer controller are formed on a single integratedcircuit.
 24. The data processing system of claim 21, wherein:said dataprocessor circuit further includesa master data processor, a pluralityof master data memories connected to said master data processor, atleast one master instruction memory supplying instructions to saidmaster data processor, and said transfer controller is further connectedto each of said master data memories and each said master instructionmemory controlling data transfer between said system memory and saideach of said master data memories and between said system memory andeach said master instruction memory.
 25. The data processing system ofclaim 24, wherein:said data processor circuit including said dataprocessor circuit, said data memories, said instruction memories, saidmaster data processor, each of said master data memories, each masterinstruction memory and said transfer controller are formed on a singleintegrated circuit.
 26. The data processor system of claim 17,wherein:said system memory consists of an image memory storing imagedata in a plurality of pixels; and said data processor system furthercomprising:an image display unit connected to said image memorygenerating a visually perceivable output of an image consisting of aplurality of pixels stored in said image memory.
 27. The data processorsystem of claim 26, further comprising:a palette forming a connectionbetween said image memory and said image display unit, said palettetransforming pixels recalled from said image memory into video signalsdriving said image display unit; and wherein said data processor circuitfurther includesa frame controller connected to said palette controllingsaid palette transformation of pixels into video signals.
 28. The dataprocessor system of claim 17, wherein:said system memory consists of animage memory storing image data in a plurality of pixels; and said dataprocessor system further comprising:a printer connected to said imagememory generating a printed output of an image consisting of a pluralityof pixels stored in said image memory.
 29. The data processor system ofclaim 28, wherein:said printer consists of a color printer.
 30. The dataprocessor system of claim 28, further comprising:a printer controllerforming a connection between said image memory and said printer, saidprinter controller transforming pixels recalled from said image memoryinto print signals driving said printer; and wherein said data processorcircuit further includesa frame controller connected to said printcontroller controlling said print controller transformation of pixelsinto print signals.
 31. The data processor system of claim 17,wherein:said system memory consists of an image memory storing imagedata in a plurality of pixels; and said data processor system furthercomprising:an imaging device connected to said image memory generatingan image signal input.
 32. The data processor system of claim 31,further comprising:an image capture controller forming a connectionbetween said imaging device and said image memory, said image capturecontroller transforming said image signal into pixels supplied forstorage in said image memory; and wherein said data processor circuitfurther includesa frame controller connected to said image capturecontroller controlling said image capture controller transformation ofsaid image signal into pixels.
 33. The data processor system of claim17, further comprising:a modem connected to said data system bus and toa communications line.
 34. The data processor system of claim 17,further comprising:a host processing system connected to said datasystem bus.
 35. The data processor system of claim 34, furthercomprising:a host system bus connected to said host processing systemtransferring data and addresses; and at least one host peripheralconnected to said host system bus.